Question: Topic is Operating Systems. Some questions could have multiple correct answers. Choose all correct answers. a point for each correct answer selected. a half-point off

Topic is Operating Systems.
Some questions could have multiple correct answers.
Choose all correct answers.
a point for each correct answer selected.
a half-point off for each incorrect answer selected.
Topic is Operating Systems. Some questions could have multiple correct answers.Choose all

QUESTIONS Threads Ti and T2 execute echo() below. Assume unbuffered I/O and that T1 and 12 share the same keyboard, processor and user space. Gete() is asyne-safe and the buffers are PIFO. Variables char_in and char_out are shared globals in which assignments guaranteed to be atomie (completed without interruption). Thread T1 Thread T2 void echo() { void echo) { 1 char ingete(); 4 char_in - gete(); 2 char out - char_in] 5 char out char in: 3 pute(char_out); 6 pute(char_out); ) > The user types 'x' followed by 'y' at the keyboard. Both T1 and 12 run to completion. You want each thread to display the value that each respectively read in. Without mutual exclusion to protect the critical code in echo (1) what could happen? DA. Whether T1 or 2 reads 'x' first is a race condition. OB. 'xxcould be displayed oc. yy' could be displayed OD. 'yx' could be displayed Unbrattered means as soon as the user hits x, whichever thread han access to the keyboard reads x inmediately; since both process run to completion you know that deadlock does not OCCUT no x and y are both read: st in race condition for the keyboard and and for the monitor - 1 execution is 124356 then xy is displayed: if execution is 142356 then yy is displayed: there is no way that yx can be displayed QUESTION 7 Assume the classic readers/writers problem with 5 readers and 2 writers. DA. If one writer is writing then 5 readers and 1 writer are locked out. OB. It will take at least seven semaphores to solve this problem. OC. A semaphore initialized to 5 with semop -1 can control writers. OD. You need one semaphore to control readers and one to control writers. Hint: mutual exclusion means no more than one process can be secuting critical section of code. A semaphore of value 5 does not make sense to control writers because only one writer can be in the critical section. QUESTIONS A strong semaphore OA. uses the FIFO policy for releasing blocked processes from the queue. OD. does not specify the order in which waiting processes are unblocked. c. can be used to prevent deadlock. Hint: a strong semaphore is used to prevent starvation: a weak semaphore does not specify the order so starvation can occur QUESTIONS A monitor is a programming language construct that CA. encapsulates data and procedures within an abstract data type. OD. is implemented in Java to manage synchronization. oc. provides procedures to access condition variables in the monitor. OD. lets one process actively access the monitor at a time--others are queued. Hint: in java a monitor is class that controls mutual exclusion QUESTION 10 In CA. direct addressing means the send primitive holds the destination address. OB. indirect addressing means msgs go to a temporary shared data structure. OC. every message has its own mailbox. OD. a blocking send & blocking receive scenario is called a rendevous. Hint: a mailbox is the data structure used in Indirect addressing

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!