Exercise chapter 2: Process and thread
1. List the difference between a program and process
2. What is the thread and list the components of the thread ?
3. List the difference between process and thread ?
4. From figure 1., answer the following questions:
Figure 1. The state of a process
a. Which state has the queue of processes ?
b. Which state performs execution ?
c. Which is the state of a parent process when it waits for a child process terminated ?
d. When the interrupt will be occurred ?
e. What happen in ready state ?
f. Show a sample of event that a process is changed from running to waiting state.
g. Show a sample of event that a process is changed from waiting to ready state.
h. Show a sample of event that a process is changed from ready to running state.
5. What is cascading termination ?
6. List three benefits of the thread.
7. Explain that what are single thread process and multithreaded process in figure 2.?
Figure 2. Single and multithread processes
8. When a process creates a new process using the fork() operation, which of the following
part in RAM is shared between the parent process and the child process?
a. Stack or b. Heap or c. Shared memory segments
9. What is context switching and show an example of context switching in computer
system ?
10. Message passing and shared memory are the methods that any two processes use to
communicate to each other. Draw diagram and explain these methods