This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

File queue using memory mapped file  RSS feed

 
Aniruddha Paradker
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I want to implement File queue (FIFO) using memory mapped file. I will be writing multiple serializable objects in a file and later these object will be read.
I need to maintain the order i.e FIFO. I can implement it by using RandomaccessFile, but is it possible to implement it using memory mapped file?

Thanks,
Aniruddha
 
Mike Simmons
Ranch Hand
Posts: 3090
14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, if you can do it with a RandomAccessFile, you can do it with a memory mapped file channel. They support essentially the same set of operations.
 
William Yang
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just wrote a big, fast and persistent queue by leveraging memory mapped file, you can find it here:
https://github.com/bulldog2011/bigqueue
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!