Hi all, Having read an extensive discussion on the new java.nio package here on java ranch here , I have concluded that nio package does not give support for ASYNCHRONOUS/NON BLOCKING writing to the file.
Following a search of the web I have seen multiple places where others have concluded the same : e.g. example "Java NIO doesn't support non-blocking file IO. Only non-blocking socket IO. If you look you'll see that the FileChannel does not extend the SelectableChannel and so cannot be set to non-blocking mode or registered with a selector."
So, my question is : Does anyone have anyone have any ideas how multiple threads can write to the same file at the same time without blocking while writing? Or is this actually even possible?! The reason behind this is that i have many worker threads which may need to log data to an infoLog file at anytime during their execution and I want them to be as optimized (ie non blocking) as possible.