I just discovered that just has an NIO facility, Java NIO Pipe that\'s designed for passing data between threads. Is there any advantage of using this mechanism over the more co
Usually the simplest way to pass data for another thread to process is to use an ExecutorService. This wraps up both a queue and a thread pool (can have one thread)
You can use a Pipe when you have a library which supports NIO channels. It is also useful if you want to pass ByteBuffers of data between threads.
Otherwise its usually simple/faster to use a ArrayBlockingQueue.
If you want a faster way to exchange data between threads I suggest you look at the Exchanger however it is not as general purpose as an ArrayBlockingQueue.
The Exchanger and GC-less Java