I'm trying to modify a serial program that reads from a database, and writes results to a file, this is done in a blocking way and I think we can get performance boost of there is a memory buffer and have the file being written in the "background" asynchronously
I can think of the "job interview" solution, using Threads, shared resource, syncronized blocks etc... but I'm sure there is a better way (is there a nice little "delayed write" library out there that will do it for me?)
Does any of the java.util.concurrent package offer any help? java.nio? or perhaps JMS/ActiveMQ?
What about PipedOutputStream / PipedInputStream as a basis for my buffer?
How do I implement a delayed / background / buffered / non-blocking / asynchronous file writter in Java?