On Thu, 2003-02-06 at 04:41, Henrique wrote: > Folks, what's the diference between Native and Green Threads for the > performance of a software and for System Operation?
Green Threads is linked into the JDK to simulate a threading environment; it manages all thread creation, scheduling, communication, etc. There have been many other similar threads packages written over the years, used by apps that need multi-threading but need to run on operating systems that either don't support threads, or do it inadequately for the application. Native threads is just that, the JDK uses the threading support in the underlying operating system. The advantage of a threading package like green is that the app has identical behavior on systems with different or nonexistent threading support (plus, you can fix bugs in it!). The disadvantage is a big one, however: the app can only run in a single OS thread. This means that the app cannot benefit from OS support for things like multiple processors. Another disadvantage is that application behavior may be slightly different than native apps. On a single processor system, performance should be very similar and in some cases green may actually be slightly faster because it is lighterweight than some OS threading systems. If you have multiple processors (or your customers do), then native is the only way to go. As a developer, one should rarely worry about which threads package is running -- just use the default. The exception is that some debugging and profiling tools may not fully work with native threads, in which case use green if it's available and recommended by the tools vendor. > The new Linux Kernel 2.4.20 manage all threads as Native, but using the > concept of Green? Green vs. native threading is a Java Virtual Machine option, not a kernel one. They may share some concepts (all threading systems do), but their implementations are completely different. Tom ---------------------------------------------------------------------- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]