C Books Guide and List
C++ Books Guide and List
Best Java Books

3,749 questions

4,049 answers

114 comments

10,705 users

What is a green thread?

0 votes
30 views
asked by smith Geek (15,340 points)

2 Answers

0 votes
Native threads can switch between threads preemptively. Green threads switch only when control is  explicitly given up by a thread ( Thread.yield(), Object.wait(), etc.) or a thread performs a blocking  operation (read(), etc.). On multi-CPU machines, native threads can run more than one thread simultaneously by assigning different threads to different CPUs. Green threads run on only one CPU. Native threads create the appearance that many Java processes are running: each thread takes up its own entry in the process table. One clue that these are all threads of the same process is that the memory size is identical for all the threads - they are all using the same memory. The process table is not infinitely large, and processes can only create a limited number of threads before running out of system resources or hitting configured limits.
answered by rajesh Guru (39,140 points)
0 votes
Native threads can switch between threads preemptively. Green threads switch only when control is explicitly given up by a thread ( Thread.yield(), Object.wait(), etc.) or a thread performs a blocking operation (read(), etc.). On multi-CPU machines
answered by keem Expert (13,240 points)

Related questions

0 votes
2 answers 32 views
32 views asked by sara Guru (24,570 points)
0 votes
2 answers 14 views
14 views asked by smith Geek (15,340 points)
0 votes
1 answer 22 views
0 votes
1 answer 8 views
8 views asked by smith Geek (15,340 points)
0 votes
1 answer 35 views
...