answersLogoWhite

0


Best Answer
  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

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Demonstrate that monitors conditional critical regions and semaphores are all equivalent insofar as the same types of synchronization problems can be implemented with them?
Write your answer...
Submit
Still have questions?
magnify glass
imp
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.


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?

To form the French conditional tense, you typically use the infinitive form of the verb and add the endings "-ais," "-ais," "-ait," "-ions," "-iez," "-aient" for regular verbs. For irregular verbs, you need to learn their specific conditional stem and add the same endings.


What are contrapositive statements?

A contrapositive of a conditional is the same conditional, but with the antecedent and consequent swapped and negated. It is logically equivalent to the original statement; it means the same thing. For example, the contrapositive of, "If we all pitch in, we can leave early today," is, "If we don't leave early today, we did not all pitch in."D.If I will not purchase a nonstop flight, then I cannot afford the airfare..:BAByLOKA:.


Why is eight and three fifths equivalent to seven and eight fifths?

The two are not equivalent, so the question is not relevant.