Why Java parallel file writing is not working?
问题 I am trying to write a script that will run a .exe program 4 times with different parameters. I created one thread for each .exe run. Each thread will write an output file. My problem is that, it should write in parallel, but as you can you see on the screenshot below, the file write one after another. How should this be resolved? Here's the main method: public static void main (String args[]) { ExecutorService executor = Executors.newFixedThreadPool(4); executor.execute(new RunnableReader(