Recent questions tagged tanenbaum

239
views
0 answers
0 votes
Rewrite the program of Fig. $2-23$ to handle more than two processes.
820
views
0 answers
0 votes
Suppose that a university wants to show off how politically correct it is by applying the U.S. Supreme Court's Separate but equal is ... woman_leaves, man_leaves. You may use whatever counters and synchronization techniques you like.
372
views
0 answers
0 votes
Solve the dining philosophers problem using monitors instead of semaphores.
378
views
0 answers
0 votes
Assume that you have an operating system that provides semaphores. Implement a message system. Write the procedures for sending and receiving messages.
212
views
0 answers
0 votes
Write a shell script that produces a file of sequential numbers by reading the last number in the file, adding $1$ to it, and then appending it to the file. Run ... to prevent the race.(Hint: use ln file file.lock to lock the data file.)
323
views
0 answers
0 votes
The readers and writers problem can be formulated in several ways with regard to which category of processes can be started when. Carefully describe three different ... to access the database, and what happens when a process is finished.
204
views
0 answers
0 votes
Consider the procedure put forks in Fig. $2-47$. Suppose that the variable $state[i]$ was set to THINKING after the two calls to test, rather than before. How would this change affect the solution?
200
views
0 answers
0 votes
In the solution to the dining philosophers problem (Fig. $2-47$), why is the state variable set to HUNGRY in the procedure take_forks?
626
views
0 answers
0 votes
Consider a system in which it is desired to separate policy and mechanism for the scheduling of kernel threads. Propose a means of achieving this goal.
1.4k
views
1 answers
0 votes
A real-time system needs to handle two voice calls that each run every $6$ msec and consume $1$ msec of CPU time per burst, plus one video at $25$ frames/sec, with each frame requiring $20$ msec of CPU time. Is this system schedulable?
571
views
0 answers
1 votes
In the dining philosophers problem, let the following protocol be used: An even-numbered philosopher always picks up his left fork before picking up his ... picking up his left fork. Will this protocol guarantee deadlock-free operation?
3.0k
views
2 answers
1 votes
A soft real-time system has four periodic events with periods of $50, 100, 200,$ and $250$ ... , respectively. What is the largest value of $x$ for which the system is schedulable?
2.3k
views
1 answers
1 votes
The aging algorithm with $a = 1/2$ is being used to predict run times. The previous four runs, from oldest to most recent, are $40, 20, 40,$ and $15$ msec. What is the prediction of the next time?
322
views
0 answers
0 votes
For the above problem, can another video stream be added and have the system still be schedulable?
1.4k
views
1 answers
0 votes
Consider a real-time system with two voice calls of periodicity $5$ msec each with CPU time per call of $1$ msec, and one video stream of periodicity $33$ ms with CPU time per call of $11$ msec. Is this system schedulable?
801
views
1 answers
1 votes
A process running on $CTSS$ needs $30$ quanta to complete. How many times must it be swapped in, including the very first time (before it has run at all)?
616
views
0 answers
0 votes
Five batch jobs. $A$ through $E$, arrive at a computer center at almost the same time. They have estimated running times of $10, 6, 2, 4,$ and $8$ ... that only one job at a time runs, until it finishes. All jobs are completely CPU bound.
3.1k
views
1 answers
0 votes
Five jobs are waiting to be run. Their expected run times are $9, 6, 3, 5,$ and $X$. In what order should they be run to minimize average response time? $($Your answer will depend on $X.)$
2.2k
views
1 answers
1 votes
Measurements of a certain system have shown that the average process runs for a time $T$ before blocking on $I/O$. A process switch requires a time $S$, which is effectively wasted (overhead ... Q > T$S < Q < T $Q = S$Q\: \text{nearly}\: 0$
2.4k
views
1 answers
0 votes
Explain how time quantum value and context switching time affect each other, in a round-robin scheduling algorithm.
1.1k
views
1 answers
0 votes
Can a measure of whether a process is likely to be CPU bound or I/O bound be determined by analyzing source code? How can this be determined at run time?
1.5k
views
3 answers
0 votes
Round-robin schedulers normally maintain a list of all runnable processes, with each process occurring exactly once in the list. What would happen if a process occurred twice in the list? Can you think of any reason for allowing this?
3.7k
views
8 answers
5 votes
Consider the following piece of C code: void main( ) { fork( ); fork( ); exit( ); }How many child processes are created upon execution of this program?
922
views
1 answers
1 votes
The $CDC\: 6600$ computers could handle up to $10\: I/O$ processes simultaneously using an interesting form of round-robin scheduling called processor sharing. ... how much time would it need if processor sharing was used with n processes?
405
views
0 answers
0 votes
Suppose that we have a message-passing system using mailboxes. When sending to a full mailbox or trying to receive from an empty one, a process does not block ... , over and over, until it succeeds. Does this scheme lead to race conditions?
622
views
0 answers
0 votes
A fast-food restaurant has four kinds of employees: $(1)$ order takers, who take customers' orders; $(2)$ cooks, who prepare the food; $(3)$ ... What form of interprocess communication do they use? Relate this model to processes in UNIX.
710
views
1 answers
0 votes
Synchronization within monitors uses condition variables and two special operations, wait and signal. A more general form of synchronization would be to have a single ... is not used. Why not? (Hint: Think about the implementation.)
344
views
0 answers
0 votes
Can two threads in the same process synchronize using a kernel semaphore if the threads are implemented by the kernel? What if they are implemented in ... threads in any other processes have access to the semaphore. Discuss your answers.
1.2k
views
1 answers
0 votes
If a system has only two processes, does it make sense to use a barrier to synchronize them? Why or why not?
384
views
0 answers
0 votes
Show how counting semaphores (i.e., semaphores that can hold an arbitrary value) can be implemented using only binary semaphores and ordinary machine instructions.