answersLogoWhite

0

  1. Semaphore waiting lists are often implemented as FIFO queues. Could they be implemented as stacks? What problems would this implementation cause?

  2. As discussed in class, a monitor is the result of a fusion between shared data and the functions (methods) that operate on this data. The code below makes the assumption that a monitor can declared just like a class in C++. This is a hypothetical situation.

    Consider the following solution to the dining philosopher's problem: monitor Chopsticks { private: // variable declarations go here public: void pickup( int philosopherNumber ); void putdown( int philosopherNumber ); }; Chopsticks::pickup( int philosopherNumber ) { // function body goes here } Chopsticks::putdown( int philosopherNumber ) { // function body goes here } //-------------------------------------------- Chopsticks chopsticks; void philosopher( int n ) { while ( true ) { think(); chopsticks.pickup( n ); eat(); chopsticks.putdown( n ); } }

    Write declarations for the shared variables needed by the monitor and the pseudo-code for the bodies of the two monitor functions. Be sure that your solution is deadlock and starvation free.

  3. Write a solution of the dining philosophers problem that uses message passing and a central coordinating process the the philosophers communicate with when they want to start or stop eating.

  4. Do problem 6.9 in the text: Demonstrate that monitors, conditional critical regions, and semaphores are all equivalent, insofar as the same types of synchronization problems can be implemented with them.

    Hint: Show that if one of the mechanisms is available then another can be implemented. Then show that if that mechanism is available then the third can be implemented. Finally, show that if the third is available then the first can be implemented. That is: if each of the mechanisms is represented by one of the letters A, B or C, show thatA => B => C => A

    which shows that these mechanisms are all logically equivalent.

  5. Suppose that an operating system supported message passing, but did not directly support semaphores. Show how you could implement semaphores by the use of suitable library routines. (Hint: Use a semaphore manager process that receives wait() and signal() messages from other processes).

  6. (Optional for extra credit) Your answers to the last two problems show that message passing is at least as powerful as the other three process coordination primitives that rely on shared memory. (Given message passing, you could implement semaphores, etc.) Show how you could implement the message passing primitives send() and receive() on a shared memory system using any of the other three schemes (your choice).

User Avatar

Wiki User

13y ago

What else can I help you with?

Related Questions

What is the converse of the inverse of the conditional of the contrapositive?

The converse of an inverse is the contrapositive, which is logically equivalent to the original conditional.


What is logically equivalent to a conditional statement?

A Contrapositive statement is logically equivalent.


What is logically equivalent to the inverse of a conditional statement?

The conditional statement "If A then B" is equivalent to "Not B or A" So, the inverse of "If A then B" is the inverse of "Not B or A" which is "Not not B and not A", that is "B and not A",


A conditional statement is always logically equivalent to its?

Contrapositive


Choose the statement that are always logically equivalent?

a conditional and its contrapositive


The converse and inverse of a conditional statement are logically equivalent?

This is not always true.


What is the inverse of the contrapositive of the converse?

This would be logically equivalent to the conditional you started with.


Which statement always has the same truth value as the conditional?

The statement "if not p, then not q" always has the same truth value as the conditional "if p, then q." They are logically equivalent.


What is 'the conditional tense' when translated from English to French?

Le mode conditionnel is a French equivalent of the incorrect English phrase "the conditional tense." The masculine singular definite article, noun, and adjective translate literally and properly into English as "the conditional mood," whose tense may be present or past. The pronunciation will be "luh muhd ko-dee-tsyo-nel" in French.


How can you explain the if a then b statement?

It is a logical conditional statement which states that if some condition, a, is satisfied then another condition, b, must be satisfied. If a is not satisfied then we can say nothing about b.An equivalent statement, in a non-conditional form, is that~b or a must be TRUE, where ~b denotes not b.


How do you form the french conditional tense?

First of all, the Conditional is a Mood and not a Tense. Tenses tell when. Formation is quite simple. a. Write your subject. b. Write the Future Tense stem. c. After the Future Tense stem, write the equivalent Imperfect stem. For example. Je+parler+ais=Je parlerais.


What the true biconditional statement that can be formed from the conditional statement If a number is divisible by 2 then it is even and its converse.?

The true biconditional statement that can be formed is: "A number is even if and only if it is divisible by 2." This statement combines both the original conditional ("If a number is divisible by 2, then it is even") and its converse ("If a number is even, then it is divisible by 2"), establishing that the two conditions are equivalent.