# Operating System Problems

1. Consider a system of 9 processes, P = {p1, …, p9} Associated with the system are 6 memory cells, M = {M1, .., M6}

The domain and range for each process is given in the following table:

Process pi

Domain D(pi)

Range R(pi)

p1

M1, M2

M3

p2

M1

M5

p3

M3, M4

M1

p4

M3, M4

M5

p5

M3

M4

p6

M4

M4

p7

M5

M6

p8

M3, M4

M2

p9

M5, M6

M6

In addition, you are given the following precedence relation:

 = {(1,2),(1,6),(2,3),(2,4),(2,5),(3,6),(3,8),(4,6),(4,7),(5,7),(5,8),(6,8),(6,9),(7,9),(8,9)}

a. Construct the Precedence Graph (not containing any redundant or transitive edges)

b. Determine if the system above is always determinate. If it is not, add to  necessary elements to make it determinate.

1. Suppose we are dealing with a system of 5 processes with a set of constraints that are expressed by the following precedence relation: :{(P1,P3), (P1, P5), (P2,P4), (P3, P4), (P4, P5)}

As a programmer, show how you can use semaphores to enforce these constraints (i.e., the precedence relation ).

1. Write a simple sequence-number system in C through which three concurrent processes, P1, P2, and P3, each obtaining 200 unique integers. Use the fork() call to create P, P2, and P3. Given a file, F, containing a single number, each process must perform the following steps:
2. Open F
3. Read the sequence number N from the file
4. Close F
5. Output N and the process’ PID (either on screen or test file)
6. Increment N by 1
7. Open F
8. Write N to F
9. Close F.

Will the numbers that are read by the processes P1, P2, and P3 be always unique or do you observe duplicates of numbers being obtained by different processes (i,e, does a particular integer x appear in the output of more than on process)? What the final number in the file will be? Rewrite the above program so as to guarantee that no duplicate number are ever obtained by the processes. Briefly describe why the code sequence above can lead duplication of sequence numbers and discuss how your solution will avoid duplicates.

## Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
\$26
The price is based on these factors:
Number of pages
Urgency
Basic features
• Free title page and bibliography
• Unlimited revisions
• Plagiarism-free guarantee
• Money-back guarantee
On-demand options
• Writer’s samples
• Part-by-part delivery
• Overnight delivery
• Copies of used sources
Paper format
• 275 words per page
• 12 pt Arial/Times New Roman
• Double line spacing
• Any citation style (APA, MLA, Chicago/Turabian, Harvard)

# Our Guarantees

### Money-back Guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

### Zero-plagiarism Guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

### Free-revision Policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.