If the threads are connected to the CPU, that is, the code never expects anything and the maximum processing speed of ticks, then the use of X is optimal. Although using up to 2X was just fine in my tests on Java 6. (Even 4X was just a slight slowdown, but YMMV)
However, if streams wait a lot of time on disk or network IO, synchronized data structures, GPUs, etc., then you should use more than X, so it will almost always work, even if several are waiting.
source
share