1. Circle the following components of program state that are shared across threads in a multi-threaded process:
a. Register Values
b. Heap memory
c. Global values
d. Stack memory
e. Open Files
a, c, e.
Registers are part of the virtual CPU, as are stack and thread-private memory.
2. A good solution to the cirtical section problem included the condition of pregress, where each process waiting for entry to the critical section will be granted entry in order of arrival.
Bounded waiting can be granted only after a certain amount of tried.
3. With user-level threads, thread control blocks are stored in memoery outside the kernel and managed in user mode.
Everything that happens with management is done at user-level. The kernel doesn’t know about them. Only the process can manipulate them.
4. In an operating system that can schedule kernal level threads, there may be two independent thread scheduling mechanisms.
There could be a user-level thread management system as well as the kernel’s.
5. A course-gained atomic action is one in which the statements in the critical section for a data item are designed so that the critical section cannot be executed concurrently with itself or other cirical sections for that data item.
They are functionally indivisible. This is the def. of the critical path setion.
6. A thread pool is a collection of kernel threads, which can be created at process startup, reducing the real-time overhead of creating new application threads.
When a user process creates a new thread, we’d like to map it to an existing kernel thread. The idea of pools is to have the threads already created, and it will map to a kernal thread. There is a delay involved with creating additional threads at the kernel level for user-level threads to map to.
7. Race conditions are possible in concurrent programs because of the unpredictable interleaving of atomic actions in the programs.
Solve this and get a turing prize. Inturrupts aren’t serviced during atomic actions, for example.
8. In multithreaded programs, the kernel can inform an application about certain events using a proceadure known as an ______
This sends a signal to the thread library to tell it to, for example, run another thread while that thread is locked. It is like a reverse
Not a signal, as they can/are be used for inter-process communication instead of an upcall, which is specific to threading. Also, the kernal can throw signals but not upcalls. The user-level thread library can receive signals, though.
9. Signals are delivered to a process, notifying it of the occurrence of an event, and synchronous signals are delivered to the thread running when the signal occurs.
Async signals can be handled by any running thread.
Sync signals are in response to a failure (hardware-based): These are delivered to a running thread.
10. A successful call to an exec() function has a return to the calling program of a value 0, indicating no error.
There is nobody to return to if you exec, exec overlays the running process (including, pid and other things, like file pointers)