search
Login

Categories


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

3.8k questions

4k answers

117 comments

10.7k users

0 votes
32 views
asked Geek 15.3k points 16 41 63

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 Guru 39.1k points 10 21 33
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 Expert 13.2k points 27 40 59

Related questions

0 votes
2 answers 36 views
36 views
asked sara Guru 24.6k points 29 52 81
0 votes
2 answers 17 views
17 views
asked smith Geek 15.3k points 16 41 63
0 votes
1 answer 24 views
24 views
asked sara Guru 24.6k points 29 52 81
0 votes
1 answer 10 views
10 views
asked smith Geek 15.3k points 16 41 63
0 votes
1 answer 43 views
43 views
asked smith Geek 15.3k points 16 41 63
...