3 ms·
It is possible to manage it manually using Executors. Take a look at thread pools in http://download.oracle.com/javase/tutorial/essential/concurrency/executors.
by mzl 16y ago
It is possible to manage it manually using Executors. Take a look at thread pools in http://download.oracle.com/javase/tutorial/essential/concurrency/executors.html http://download.oracle.com/javase/tutorial/essential/concurr... for an overview look at what to do.
I hope that it works better than the last time I tried, since I will probably have to write some multi-threaded Java code quite soon :)
- lemming 16y agoThis is a little misleading. It may be true that the Java specification doesn't require Java threads to map onto system threads but for all intents and purposes they're the same in all real implementations. The Executor framework doesn't change this, it gives you a flexible framework for task scheduling using thread pools.
- mzl 16y agoA lot of my earlier work was in formal specification of JVM thread behaviour, so I was very interested in what the standard said and required. I agree that in practice, it probably will map to threads, which is unfortunate. The experiments were mostly to satisfy my curiosity on how stuff behaved in the real world.