>>>>> Christian Seiler writes:

    >> Thanks for the infos.
    >> 
    >> Question are green thread slower than native threads ?
    >> 

It depends.

    Christian> Well, hard to answer. A common opinion is that green
    Christian> threads are slower because the JVM has to do a lot of
    Christian> additional work like dispatching/serializing signals
    Christian> and other stuff for the green threads.

In general green threads are slightly faster than native threads because
they can do a faster thread switching. However, they can't take
advantage of SMP systems and they are slower than native threads when
the java process has to compete for CPU time with other processes.

    Christian> On the other side creating native threads is an
    Christian> expensive operation.  Especially on Linux, where
    Christian> threads are heavy-weight system processes.  For

Threads are not really heavy-weight on Linux, see 
http://pauillac.inria.fr/~xleroy/linuxthreads/faq.html#K 
for more information.

    Christian> applications which often create threads (e.g. servers)
    Christian> this could be a major drawback. The situation changes,
    Christian> of course, if thread pools are used.


        Juergen

-- 
Juergen Kreileder, Universitaet Dortmund, Lehrstuhl Informatik V
Baroper Strasse 301, D-44221 Dortmund, Germany
Phone: ++49 231/755-5806, Fax: ++49 231/755-5802

Reply via email to