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
28 views
asked Jan 10, 2014 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 Jan 10, 2014 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 Feb 7, 2014 by keem Expert (13,240 points)

Related questions

0 votes
2 answers 31 views
31 views asked Jan 10, 2014 by sara Guru (24,570 points)
0 votes
2 answers 13 views
13 views asked Jan 10, 2014 by smith Geek (15,340 points)
0 votes
1 answer 21 views
21 views asked Jan 20, 2014 by sara Guru (24,570 points)
0 votes
1 answer 7 views
7 views asked Jan 5, 2014 by smith Geek (15,340 points)
0 votes
1 answer 34 views
...