3 ms·
Well I meant that in regard to which JVMs people actually use...not what are theoretically possible.
by smegel 12y ago
Well I meant that in regard to which JVMs people actually use...not what are theoretically possible.
- jbooth 12y agoEven then, Java's had ExecutorService, Callable<T> and BlockingQueue<T> for a long time. Effectively the same thing as Go's green threads from a programmer's perspective, with the only real difference being that Go swaps out an executing goroutine on I/O or other syscalls (or calling any C code).
- Matthias247 12y agoNewer Go ersions will also preempt green threads on normal functions calls and not only on syscalls. Both is not possible with the JVMs primitives where you need "cooperative code". However there exists Quasar for the JVM which seems to be able to emulate something similar to green threads with the help of bytecode weaving (and inserting preemption points).
- jbooth 12y agoOk, fair enough, but if IO isn't happening, who cares if it's a runtime or the OS swapping out the 'thread'?
- pjmlp 12y agoI was also talking about JVMs people actually use. There is much more out there than OpenJDK and Oracle commercial JVM. If you want a real product example, http://www.is2t.com/products/specifications/ http://www.is2t.com/products/specifications/