Queue and singleton in Java
Posted on 2011-09-10
I want to implement a singleton queue class, which will be accessed by multiple threads.
The queue contains no more than 10000 of files. Most likely files with same prefix will be put together in the queue, but not guaranteed. I would like to have multiple thread read through the queue, identify a group of files of that kind.
I heard thread-safe is difficult to implement for queue, and would like some experts' views, suggstions and for the best, some code.