Prev | Current Page 271 | Next

Carl Reynolds and Paul Tymann

"Schaum's Outline of Principles of Computer Science"

Likewise, when one thread exhausts its
timeslice, the OS can choose another thread from the same process to receive the next timeslice.
User threads have some advantages, too. Since the OS has no knowledge itself of the threads, the OS
does not get involved with thread creation and scheduling. This lack of OS involvement means less overhead,
so creating threads and switching among threads can be more efficient with user threads.
The disadvantages of user threads are the reverse of the advantages of kernel threads. When one thread must
wait, the OS will block the entire process, for the OS has no knowledge of the different threads within the user
process. Likewise, a user thread may claim all of its process??™ CPU time, to the exclusion of the other threads. When
the user thread package transfers control to a thread, the user thread package has no way to interrupt the executing
thread after some timeslice, because the user thread package does not gain control on a clock tick as the OS does.
In the case of Java and some other languages, threads are provided as part of the language. The implementation
of the Java Virtual Machine determines how the Java Thread class is mapped to the thread model of the OS.


Pages:
259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283
Rowy noclegi tatralandia hotele świnoujście noclegi Namioty Mazury i interesująca cena South park