# Recent questions tagged tanenbaum

1
Consider the following state of a system with four processes$, P1, P2, P3,$ and $P4,$ and five types of resources, $RS1, RS2, RS3, RS4,$ and $RS5:$ Using the deadlock detection algorithm described in Section $6.4.2,$ show that there is a deadlock in the system. Identify the processes that are deadlocked.
2
The discussion of the ostrich algorithm mentions the possibility of process-table slots or other system tables filling up. Can you suggest a way to enable a system administrator to recover from such a situation?
3
In order to control traffic, a network router, $A$ periodically sends a message to its neighbor, $B,$ telling it to increase or decrease the number of packets that it can handle. At some point in time, Router $A$ is flooded with traffic and sends $B$ a message ... size from $0$ to a positive number. That message is lost. As described, neither side will ever transmit. What type of deadlock is this?
4
Suppose that there is a resource deadlock in a system. Give an example to show that the set of processes deadlocked can include processes that are not in the circular chain in the corresponding resource allocation graph.
5
Consider Fig. 6-4. Suppose that in step $(o)\: C$ requested $S$ instead of requesting $R.$ Would this lead to deadlock? Suppose that it requested both $S$ and $R.$
6
Fig. 6-3 shows the concept of a resource graph. Do illegal graphs exist, that is, graphs that structurally violate the model we have used of resource usage? If so, give an example of one.
7
Is it possible that a resource deadlock involves multiple units of one type and a single unit of another? If so, give an example.
8
Suppose four cars each approach an intersection from four different directions simultaneously. Each corner of the intersection has a stop sign. Assume that traffic regulations require that when two cars approach adjacent stop signs at the same time, the car on the left must ... (indefinitely) for the car on the left to proceed. Is this anomaly a communication deadlock? Is it a resource deadlock?
9
City streets are vulnerable to a circular blocking condition called gridlock, in which intersections are blocked by cars that then block cars behind them that then block the cars that are trying to enter the previous intersection, etc. All intersections ... the intersection is also available. Which prevention algorithm is this? Can you provide any other prevention algorithms for gridlock?
10
The four conditions (mutual exclusion, hold and wait, no preemption and circular wait) are necessary for a resource deadlock to occur. Give an example to show that these conditions are not sufficient for a resource deadlock to occur. When are these conditions sufficient for a resource deadock to occur?
11
In Fig. 6-1 the resources are returned in the reverse order of their acquisition. Would giving them back in the other order be just as good?
12
In the preceding question, which resources are preemptable and which are nonpreemptable?
1 vote
13
Students working at individual PCs in a computer laboratory send their files to be printed by a server that spools the files on its hard disk. Under what conditions may a deadlock occur if the disk space for the print spool is limited? How may the deadlock be avoided?
14
Give an example of a deadlock taken from politics.
15
Write a program to implement multiple timers using a single clock. Input for this program consists of a sequence of four types of commands $(S<int> , T<int>, E<int> , P<int>): S<int>$ sets the current time to $<int>; T$ ... out the values of Current time, Next signal, and Clock header. Your program should also print out a statement whenever it is time to raise a signal.
16
Write a program to implement the three disk-arm scheduling algorithms. Write a driver program that generates a sequence of cylinder numbers $(0–999)$ at random, runs the three algorithms for this sequence and prints out the total distance (number of cylinders) the arm needs to traverse in the three algorithms.
17
Write a program that simulates stable storage. Use two large fixed-length files on your disk to simulate the two disks.
18
A notebook computer is set up to take maximum advantage of power saving features including shutting down the display and the hard disk after periods of inactivity. A user sometimes runs UNIX programs in text mode, and at other times uses the $X$ Window System. She is surprised to find that battery life is significantly better when she uses text-only programs. Why?
19
If a CPU's maximum voltage, $V,$ is cut to $V/n,$ its power consumption drops to $1/n^{2}$ of its original value and its clock speed drops to $1/n$ of its original value. Suppose that a user is typing at $1\: char/sec,$ but the CPU time ... value of $n$ and what is the corresponding energy saving in percent compared to not cutting the voltage? Assume that an idle CPU consumes no energy at all.
20
21
It has been observed that a thin-client system works well with a $1$-Mbps network in a test. Are any problems likely in a multiuser situation? (Hint: Consider a large number of users watching a scheduled TV show and the same number of users browsing the World Wide Web.)
22
A thin-client terminal is used to display a Web page containing an animated cartoon of size $400\: \text{pixels} \times 160\: \text{pixels}$ running at $10\: \text{frames/sec.}$ What fraction of a $100$-Mbps Fast Ethernet is consumed by displaying the cartoon?
23
In the text we gave an example of how to draw a rectangle on the screen using the Windows GDI: Rectangle(hdc, xleft, ytop, xright, ybottom); Is there any real need for the first parameter (hdc), and if so, what? After all, the coordinates of the rectangle are explicitly specified as parameters.
24
In Fig. 5-36 there is a class to RegisterClass. In the corresponding $X$ Window code, in Fig. 5-34, there is no such call or anything like it. Why not?
25
Assuming that it takes $2\: nsec$ to copy a byte, how much time does it take to completely rewrite the screen of an $80\: \text{character} \times \text{25}$ line text mode memory-mapped screen? What about a $1024 \times 768$ pixel graphics screen with $24$-bit color?
26
One way to place a character on a bitmapped screen is to use BitBlt from a font table. Assume that a particular font uses characters that are $16 × 24$ pixels in true RGB color. How much font table space does each character take? If copying a byte takes $100\: nsec,$ including overhead, what is the output rate to the screen in characters/sec?
27
The primary additive colors are red, green, and blue, which means that any color can be constructed from a linear superposition of these colors. Is it possible that someone could have a color photograph that cannot be represented using full $24$-bit color?
The designers of a computer system expected that the mouse could be moved at a maximum rate of $20\: cm/sec.$ If a mickey is $0.1 \:mm$ and each mouse message is $3$ bytes, what is the maximum data rate of the mouse assuming that each mickey is reported separately?
A user at a terminal issues a command to an editor to delete the word on line $5$ occupying character positions $7$ through and including $12.$ Assuming the cursor is not on line $5$ when the command is given, what ANSI escape sequence should the editor emit to delete the word?