Preview

It325 Assignment 7

Better Essays
Open Document
Open Document
1251 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
It325 Assignment 7
King Saud University
College of Computer & Information Sciences
Information Technology Department
IT 325: Operating Systems

Assignment 7 first Semester 1433/1434H – 2012/2013

Q1) The following is a set of three interacting processes that can access two shared semaphores: semaphore U = 2; semaphore V = 0; [Process 1] [Process 2] [Process 3] L1:wait(U) L2:wait(V) L3:wait(V) type("B") type("D") type("A") signal(V) type("C") goto L3 goto L1 signal(V) goto L2
Within each process the statements are executed sequentially, but statements from different processes can be interleaved in any order that's consistent with the constraints imposed by the semaphores. When answering the questions below assume that once execution begins, the processes will be allowed to run until all 3 processes are stuck in a wait() statement, at which point execution is halted. A. Assuming execution is eventually halted, how many A's are printed when this set of processes runs? B. Assuming execution is eventually halted, how many B's are printed when the set of processes runs? C. What is the smallest number of D's that might be printed when this set of processes runs?

D. Is BDCDCAABDCBDCA a possible output sequence when this set of processes runs? E. Is BDCDBACBDCAA a possible output sequence when this set of processes runs?

Yes: start: U=3 V=0 type C: U=2 V=1 type A: U=2 V=0 type B: U=2 V=1 type A: U=2 V=0 type C: U=1 V=1 type D: U=1 V=0 type B: U=1 V=1 type C: U=0 V=2 type A: U=0 V=1 type B: U=0 V=2 type D: U=0 V=1

You May Also Find These Documents Helpful

  • Good Essays

    Nt1310 Unit 8 Assignment 1

    • 1415 Words
    • 6 Pages

    This project used an Atmega644 microcontroller clocked at 20MHz in each of the two functional modules for processing. Memory storage is provided by a standard Secure Digital (SD) card. Xbee modules provide bidirectional wireless communication and we use the TLV5616 DAC chip for generating analog audio. The LM358 dual op amp provides active filtering to the output of the DAC. Music files can be added to the SD card using any computer with a multimedia card reader. Once the base station detects an SD card inserted into the holder, it awaits data requests from the portable module. The portable module requests data when required and feeds these values into the DAC. The DAC output is low-pass filtered by the op amp, which also buffers the DAC output before it reaches the audio output…

    • 1415 Words
    • 6 Pages
    Good Essays
  • Satisfactory Essays

    A good example of refraction of light and reflection of light is a rainbow. Sunlight enters the rain droplet at a specific angle and the rain droplet separates the white light into many different colors. This angle is a fixed measurement between your eye and the sun. What color is refracted depends upon the critical angle, which is the angle the sunlight strikes the back of the rain droplet. Red light bends the least while violet light bends the most all the other colors bend at an angle that is between the two. Each rain droplet reflects all colors at a given point and time, but only one color comes back to your eye, requiring millions of rain droplets to create a rainbow. As the rain droplets fall…

    • 395 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Lab 6

    • 690 Words
    • 3 Pages

    1. Run your model. Compare the queue statistics of the 3 processes with those obtained for Part C in the previous Lab. How have they changed and what conclusions can you draw? (Note the sums of all capacities for both cases are equivalent – 12 in each).…

    • 690 Words
    • 3 Pages
    Satisfactory Essays
  • Satisfactory Essays

    IT302 Assignment 5.1

    • 308 Words
    • 2 Pages

    Setting /etc/vsftpd/ftpusers lists users that are not allowed to log in on the FTP server…

    • 308 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    2. It only runs as many times as you have instructed the program to run…

    • 351 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    Questions 1, 2, 3, 6, 7, 10, and 12 on page 84.Q1. Classify the following types of processes as continuous, assembly line, batch, job shop, or project:…

    • 1157 Words
    • 6 Pages
    Good Essays
  • Satisfactory Essays

    3232

    • 1048 Words
    • 4 Pages

    to the first teller, B to the second teller, and C queues. To standardize the answers, let us…

    • 1048 Words
    • 4 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Abuse Paper Outline

    • 1129 Words
    • 5 Pages

    1. Although it is hard to get an exact number of these cases because most…

    • 1129 Words
    • 5 Pages
    Satisfactory Essays
  • Good Essays

    Answer & ExplanationAnswer: Option CExplanation:Option C is correct. The output is "ELSE". Only when a is false do the output lines after 11 get some chance of executing.Option A is wrong. The output is "A". When a is true, irrespective of the value of b, only the line 5 output will be executed. The condition at line 7 will never be evaluated (when a is true it will always be trapped by the line 12 condition) therefore the output will never be "A && B". Option B is wrong. The output is "A". When a is true, irrespective of the value of b, only the line 5 output will be executed. Option D is wrong. The output is "notB".…

    • 2262 Words
    • 10 Pages
    Good Essays
  • Satisfactory Essays

    23 Process …………………………… …………………………………………..... 23 Physical…

    • 5088 Words
    • 21 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Fork System Call

    • 258 Words
    • 2 Pages

    Exp#2 fork system call Aim To create a new child process using fork system call. Algorithm 1. Declare a variable x to be shared by both child and parent. 2. Create a child process using fork system call.…

    • 258 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    Learning Paradigm

    • 362 Words
    • 2 Pages

    c) Once 5 records are stored, no further entry is allowed and Screen Two is displayed.…

    • 362 Words
    • 2 Pages
    Good Essays
  • Good Essays

    lru algorithm report

    • 842 Words
    • 3 Pages

    Now, first major problem mentioned in Section 9.4.1 will be discussed. How do we allocate the fixed amount of free memory among the various processes?…

    • 842 Words
    • 3 Pages
    Good Essays
  • Good Essays

    OOPS Assignment 1

    • 850 Words
    • 6 Pages

    Q1. Prepare a list of objects that you would expect each of the following system to handle…

    • 850 Words
    • 6 Pages
    Good Essays
  • Good Essays

    NECESSARY CONDITIONS ALL of these four must happen simultaneously for a deadlock to occur: Mutual exclusion One or more than one resource must be held by a process in a non-sharable (exclusive) mode. Hold and Wait A process holds a resource while waiting for another resource. No Preemption There is only voluntary release of a resource - nobody else can make a process give up a resource. Circular Wait Process A waits for Process B waits for Process C .... waits for Process A.…

    • 1034 Words
    • 5 Pages
    Good Essays