ThreadPool does not run tasks in sequence
问题 I am using the Executor framework specifically Executors.newCachedThreadPool(); I have a list of Runnable s e.g. 100. The first 50, each create a value (stored in a list) to be used by the last 50. I thought that if I pass the Runnable s in the executor.execute() in the order they are in the list, they would be also executed in the same order. But this is not happening. The tasks seem to be executed in random order and they are interleaved, not executed in sequence. Is this how it is suppose