Use LEFT and RIGHT arrow keys to navigate between flashcards;
Use UP and DOWN arrow keys to flip the card;
H to show hint;
A reads text to speech;
6 Cards in this Set
- Front
- Back
Provide two programming examples in which multi-threading provides better performance than a single-threaded solution. |
(1) A Web server that services each request in a separate thread. (2) A parallelized (3) An interactive GUI program such as a debugger where a |
|
Describe the actions taken by a kernel to context-switch between kernel level threads. |
Context switching between kernel threads typically requires saving the value of the CPU registers fromthe thread being switched out and restoring the CPU registers of the new thread being scheduled. |
|
?What resources are used when a thread is created? How do they differ from those used when a process is created? |
A context must be created, including a register set storage location for storage during context switching, and a local stack to record the procedure call arguments, return values, and return addresses, and thread-local storage. A process creation results in memory being allocated for program instructions and data, as well as thread-like storage. Code may also be loaded into the allocated memory. |
|
Provide two programming examples in which multi-threading does not provide better performance than a single-threaded solution. |
Any kind of sequential program is not a good candidate to be threaded. An example
|
|
Under what circumstances does a multi-threaded solution using multiple kernel threads provide better performance than a single-threaded |
When a kernel thread suffers a page fault, another kernel thread can be switched in to |
|
Can a multi-threaded solution using multiple user-level threads achieve better performance on a multiprocessor system than on a single processor system? Explain. |
No. The kernel is not aware of the user-level threads that are created. Therefore, it is not able to run the user-level threads on different processors. |