My understanding of green vs. native threads is as
follows:
With native threads, an actual system thread is
created when a Java thread is created.
On linux a system thread takes the form of another
process, but one that shares memory
etc. with another process. This is why if you
create a program that allocates 100 megs of memory,
then spins off 10 threads, it looks like 10
processes each taking up 100 megs of memory, when in
fact the amount of memory is 100 megs + 10*overhead
for each thread (not much more than 100 megs).
On WIN32 systems, threads do not show up as
separate processes, they are separate threads of execution
inside the same process (essentially the same as
the Linux implementation with differences too subtle to care about)
Green threads on the other hand use timers,
signals, setjmp etc. voodoo to "simulate" threads within one
process.
Essentially taking over the scheduling from the
kernel.
I believe the command-line option for green threads
is simply "-green" as in
java -green MyThreaddedApp
If you have a multi-cpu system, green threads will
only take advantage of one cpu, whereas native threads
will use all the cpus on your system (that's the
theory anyway)
I've heard of problems with blocking I/O with green
threads, but have no first hand knowledge.
Hope this helps.
-Mike Jennings
|
Title: RE: ** JVM and Processes
- RE: ** JVM and Processes Randy Layman
- RE: ** JVM and Processes myatt83
- RE: ** JVM and Processes BARRAUD Valérie
- Re: ** JVM and Processes Michael Jennings
- Re: ** JVM and Processes Jeff Kilbride
- Re: ** JVM and Processes myatt83
- Re: ** JVM and Processes Jeff Kilbride
- Re: ** JVM and Processes myatt83
- Upgrading tomcat 3.2.1 to ... Brandon Cruz
- Re: Upgrading tomcat 3.2.1... David Lennartsson