Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

What is the difference between “green” threads and “native” threads?

difference native threads
0
Posted

What is the difference between “green” threads and “native” threads?

0

Created: Sep 6, 2000 Author: Nathan Meyers (http://www.jguru.com/guru/viewbio.jsp?EID=138686) Both green and native threads are mechanisms to support multithreaded execution of Java programs. Some JDK distributions (such as Blackdown’s) include the option to run with either type of threading. Native threads use the operating system’s native ability to manage multi-threaded processes – in particular, they use the pthread library. When you run with native threads, the kernel schedules and manages the various threads that make up the process. Green threads emulate multithreaded environments without relying on any native OS capabilities. They run code in user space that manages and schedules threads; Sun wrote green threads to enable Java to work in environments that do not have native thread support. There are some important differences between using the two in a Linux environment: • Native threads can switch between threads pre-emptively, switching control from a running thread to a non-

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123