DOC PREVIEW
Winthrop CSCI 411 - Test # 2 - Review

This preview shows page 1 out of 2 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 2 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 2 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

CSCI 411 Test # 2 - Review March 11, 20090. Define: process; interrupt.1. Define: IPC mechanism; IPC pattern.2. Describe each of these Linux IPC mechanisms and the Linux systems calls for each:1. Semaphore2. Pipe3. pthread mutex3. Describe each of these IPC patterns:1. Mutual Exclusion pattern (ME)2. Signaling pattern3. Rendezvous pattern4. Producer-Consumer pattern4. Write the pseudo code implementation of each pattern using the specified IPC mechanism:a. Semaphoreb. Pipec. pthread mutex5. Write a program that uses a semaphore to protect a critical section of code that does something, and theprogram forks a child and the parent and child both use the critical section.6. Write a program that uses a pipe to communicate. The program forks a child and the child writes to thepipe and te parent reads from the pipe.7. a. Explain (define) what a thread is. Explain the relationship between a thread and a process, that is,the similarities and differences of the process and its threads..b. Explain the importance of the having threads - the advantage(s). 8. Explain each of these Linux pthread system calls - their purpose/function, parameters and result:a. pthread_createb. pthread_join9. Write the program that has the process create two threads, and each executes its own separate procedure,one a “Hello there procedure”, and the other a sleep-and-“bye, now” procedure.(Chapter 3 topics)10. Define: critical section.State the requirements for mechanisms that are to be used to control critical sections.11. a. Define: deadlock. Illustrate with a diagram and the code timing for two or three processes and twoor three resources.b. List the four conditions that must hold for a deadlock to occur, the first three which are necessaryconditions (each must exist for deadlock to occur, but deadlock does not have to occur), and thefourth a sufficient condition (guarantees deadlock).CSCI 411 Test # 2 Review Page 212. Deadlock Avoidancea. Define: safe state. b. Explain how the Banker’s algorithm works to keep the system in a safe state.c. Describe how this is implemented in code, that is, explain the code on pages 61-62.13. Deadlock Detectiona. Describe the deadlock detection approach.b. Draw the Resource Allocation Graph for a two-process-two-resource situation that is deadlocked.c. State the three rules for reducing a Resource Allocation Graph to detect a deadlock.d. Given a Resource Allocation Chart (see problem 3.12 for example), draw its Resource AllocationGraph. Then reduce the RAG to determine if a deadlock is detected.e. Describe how this is implemented in code, that is, explain the code on pages 64-65.d. Explain the methods of recovering from a detected deadlock.14. a. Describe the dining philosophers problem. Diagram the RAG for the problem.b. Write the pseudo code for a


View Full Document

Winthrop CSCI 411 - Test # 2 - Review

Documents in this Course
Load more
Download Test # 2 - Review
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Test # 2 - Review and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Test # 2 - Review 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?