Recent questions tagged tanenbaum

1.1k
views
1 answers
0 votes
How could an operating system that can disable interrupts implement semaphores?
401
views
0 answers
0 votes
Consider the following solution to the mutual-exclusion problem involving two processes $P0$ and $P1$. Assume that the variable turn is initialized to ... solution meets all the required conditions for a correct mutual-exclusion solution.
615
views
0 answers
0 votes
The producer-consumer problem can be extended to a system with multiple producers and consumers that write (or read) to (from) one shared buffer. Assume that ... solution presented in Fig. $2-28$, using semaphores, work for this system?
366
views
0 answers
0 votes
When a computer is being developed, it is usually first simulated by a program that runs one instruction at a time. Even multiprocessors are simulated strictly ... a race condition to occur when there are no simultaneous events like this?
658
views
1 answers
0 votes
In a system with threads, is there one stack per thread or one stack per process when user-level threads are used? What about when kernel-level threads are used? Explain.
370
views
0 answers
0 votes
In Sec. $2.3.4$, a situation with a high-priority process, H, and a low-priority process, $L$, was described, which led to $H$ looping ... the same problem occur if round-robin scheduling is used instead of priority scheduling? Discuss.
305
views
0 answers
0 votes
Can the priority inversion problem discussed in Sec. $2.3.4$ happen with user-level threads? Why or why not?
1.7k
views
0 answers
0 votes
Does Peterson’s solution to the mutual-exclusion problem shown in Fig. $2-24$ work when process scheduling is preemptive? How about when it is nonpreemptive?
388
views
0 answers
0 votes
Does the busy waiting solution using the turn variable (Fig. $2-23$) work when the two processes are running on a shared-memory multiprocessor, that is, two CPUs sharing a common memory?
446
views
0 answers
0 votes
Suppose that an operating system does not have anything like the select system call to see in advance if it is safe to read from a file, pipe, or ... it possible to implement a threads package in user space under these conditions? Discuss.
1.4k
views
1 answers
0 votes
Consider a system in which threads are implemented entirely in user space, with the run-time system getting a clock interrupt once a second. Suppose that a clock ... system. What problem might occur? Can you suggest a way to solve it?
430
views
0 answers
0 votes
In the discussion on global variables in threads, we used a procedure create global to allocate storage for a pointer to the variable, rather than the ... essential, or could the procedures work with the values themselves just as well?
289
views
0 answers
0 votes
In Fig. $2-15$ the thread creations and messages printed by the threads are interleaved at random. Is there a way to force the order to be strictly thread $1$ created, thread ... , thread $2$ exists, and so on? If so, how? If not, why not?
325
views
1 answers
0 votes
What is the biggest advantage of implementing threads in user space? What is the biggest disadvantage?
2.8k
views
1 answers
0 votes
In this problem, you are to compare reading a file using a single-threaded file server and a multithreaded server. It takes $12$ msec to get a request for ... /sec can the server handle if it is single threaded? If it is multithreaded?
1.7k
views
1 answers
0 votes
Can a thread ever be preempted by a clock interrupt? If so, under what circumstances? If not, why not?
1.8k
views
1 answers
0 votes
Why would a thread ever voluntarily give up the CPU by calling thread yield? After all, since there is no periodic clock interrupt, it may never get the CPU back.
1.3k
views
2 answers
0 votes
In Fig. $2-12$ the register set is listed as a per-thread rather than a per-process item. Why? After all, the machine has only one set of registers.
787
views
1 answers
0 votes
In the text, we described a multithreaded Web server, showing why it is better than a single-threaded server and a finite-state machine server. Are there any circumstances in which a single-threaded server might be better? Give an example.
533
views
0 answers
0 votes
In Fig. $2-8$, a multithreaded Web server is shown. If the only way to read from a file is the normal blocking read system call, do you think user-level threads or kernel-level threads are being used for the Web server? Why?
1.4k
views
1 answers
0 votes
If a multithreaded process forks, a problem occurs if the child gets copies of all the parent's threads. Suppose that one of the original threads was ... one in each process. Does this problem ever occur in single-threaded processes?
388
views
0 answers
1 votes
In the text it was stated that the model of Fig. $2-11(a)$ was not suited to a file server using a cache in memory. Why not? Could each process have its own cache?
914
views
1 answers
0 votes
Assume that you are trying to download a large $2$-GB file from the Internet. The file is available from a set of mirror servers, each of which can ... bytes of the file. Explain how you might use threads to improve the download time.
2.9k
views
2 answers
1 votes
Consider a multiprogrammed system with degree of $6$ (i.e., six programs in memory at the same time). Assume that each process spends $40\%$ of its time waiting for I/O. What will be the CPU utilization?
2.2k
views
1 answers
0 votes
Multiple jobs can run in parallel and finish faster than if they had run sequentially. Suppose that two jobs, each needing $20$ minutes of CPU time, start simultaneously. How ... ? How long if they run in parallel? Assume $50\%$ I/O wait.
4.5k
views
1 answers
0 votes
A computer has $4$ GB of RAM of which the operating system occupies $512$ MB. The processes are all $256$ MB (for simplicity) and have the same characteristics. ... $99\%$ CPU utilization, what is the maximum I/O wait that can be tolerated?
4.1k
views
1 answers
0 votes
A computer system has enough room to hold five programs in its main memory. These programs are idle waiting for I/O half the time. What fraction of the CPU time is wasted?
2.0k
views
1 answers
2 votes
When an interrupt or a system call transfers control to the operating system, a kernel stack area separate from the stack of the interrupted process is generally used. Why?
2.5k
views
1 answers
1 votes
On all current computers, at least part of the interrupt handlers are written in assembly language. Why?
986
views
1 answers
0 votes
Suppose that you were to design an advanced computer architecture that did process switching in hardware, instead of having interrupts. What information would the CPU need? Describe how the hardware process switching might work.