In a timesharing system, multiple users can access and perform computations on a computing system simultaneously using their own terminals. Multipro- gramming systems allow a user to run multiple programs simultaneously. All timesharing systems are multiprogramming systems but not all multiprogram- ming systems are timesharing systems since a multiprogramming system may run on a PC with only one user.

You are watching: What is the advantage of caching an entire line instead of a single byte or word at a time?

4. To use cache memory, main memory is divided into cache lines, typically 32 or 64bytes long. An entire cache line is cached at once. What is the advantage of caching anentire line instead of a single byte or word at a time?
Empirical evidence shows that memory access exhibits the principle of locality of reference, where if one location is read then the probability of accessing nearby locations next is very high, particularly the following memory locations. So, by caching an entire cache line, the probability of a cache hit next is increased. Also, modern hardware can do a block transfer of 32 or 64 bytes into a cache line much faster than reading the same data as individual words.
One reason GUIs were initially slow to be adopted was the cost of the hardware neededto support them. How much video RAM is needed to support a 25-line × 80-rowcharacter monochrome text screen? How much for a 1200 × 900-pixel 24-bit color bitmap?What was the cost of this RAM at 1980 prices ($5/KB)? How much is it now?
A 25 x 80 character monochrome text screen requires a 2000-byte buffer. The 1200 900 pixel 24-bit color bitmap requires 3,240,000 bytes. In 1980 these two options would have cost $10 and $15,820, respectively. For current prices, check on how muchRAM currently costs, probably pennies per MB.
Consider a system that has two CPUs, each CPU having two threads (hyperthreading).Suppose three programs, P0, P1, and P2, are started with run times of 5, 10 and 20msec, respectively. How long will it take to complete the execution of these programs?Assume that all three programs are 100% CPU bound, do not block during execution,and do not change CPUs once assigned.
t may take 20, 25 or 30 msec to complete the execution of these programs de- pending on howthe operating system schedules them. If P0 and P1 are sched- uled on the same CPU and P2 is scheduled on the other CPU, it will take 20 msec. If P0 and P2 are scheduled on the same CPU and P1 is scheduled on the other CPU, it will take 25 msec. If P1 and P2 are scheduled on the same CPU and P0 is scheduled on the other CPU, it will take 30 msec. If all three are on the same CPU, it will take 35 msec.
Suppose that a 10-MB file is stored on a disk on the same track (track 50) in consecutivesectors. The disk arm is currently situated over track number 100. How long willit take to retrieve this file from the disk? Assume that it takes about 1 ms to move thearm from one cylinder to the next and about 5 ms for the sector where the beginning ofthe file is stored to rotate under the head. Also, assume that reading occurs at a rate of200 MB/s.
24. Time to retrieve the file = 1 50 ms (Time to move the arm over track 50) + 5 ms (Time for the first sector to rotate under the head) + 10/200
1000 ms (Read 10 MB) = 105 ms
33. Here are some questions for practicing unit conversions:(a) How long is a nanoyear in seconds?(b) Micrometers are often called microns. How long is a megamicron?(c) How many bytes are there in a 1-PB memory?(d) The mass of the earth is 6000 yottagrams. What is that in kilograms?
33. The conversions are straightforward:(a) A nanoyear is 10^9 x365 x24 x3600 = 31. 536 msec. (b) 1 meter (c) There are 250 bytes, which is 1,099,511,627,776 bytes. (d) It is 6x10^24 kg or 6 x10^27 g.
Which of the following instructions should be allowed only in kernel mode?(a) Disable all interrupts.(b) Read the time-of-day clock.(c) Set the time-of-day clock.(d) Change the memory map.
15. Consider a computer system that has cache memory, main memory (RAM) and disk,and an operating system that uses virtual memory. It takes 1 nsec to access a wordfrom the cache, 10 nsec to access a word from the RAM, and 10 ms to access a wordfrom the disk. If the cache hit rate is 95% and main memory hit rate (after a cachemiss) is 99%, what is the average time to access a word?
15. Average access time =0.95 x 1 nsec (word is in the cache) + 0.05 x 0.99 x 10 nsec (word is in RAM, but not in the cache) + 0.05 x0.01 x10,000,000 nsec (word on disk only) = 5001.445 nsec = 5.001445 sec
18. Why is the process table needed in a timesharing system? Is it also needed in personalcomputer systems running UNIX or Windows with a single user?
18. The process table is needed to store the state of a process that is currently suspended, either ready or blocked. Modern personal computer systems have dozens of processes running even when the user is doing nothing and no pro- grams are open. They are checking for updates, loading email, and many other things, On a UNIX system, use the ps -a command to see them. On a Windows system, use the task manager.
23. A file whose file descriptor is fd contains the following sequence of bytes: 3, 1, 4, 1, 5,9, 2, 6, 5, 3, 5. The following system calls are made:lseek(fd, 3, SEEK SET);read(fd, &buffer, 4);where the lseek call makes a seek to byte 3 of the file. What does buffer contain afterthe read has completed?
27. Modern operating systems decouple a process address space from the machine"s physicalmemory. List two advantages of this design.
27. This allows an executable program to be loaded in different parts of the ma- chine"smemory in different runs. Also, it enables program size to exceed the size of themachine"s memory.
3. On all current computers, at least part of the interrupt handlers are written in assemblylanguage. Why?
Generally, high-level languages do not allow the kind of access to CPU hard- ware that is required. For instance, an interrupt handler may be required to enable and disable the interrupt servicing a particular device, or to manipulate data within a process" stack area. Also, interrupt service routines must execute as rapidly as possible.
9. Assume that you are trying to download a large 2-GB file from the Internet. The file isavailable from a set of mirror servers, each of which can deliver a subset of the file"sbytes; assume that a given request specifies the starting and ending bytes of the file.Explain how you might use threads to improve the download time.
possible.9. The client process can create separate threads; each thread can fetch a different part of the file from one of the mirror servers. This can help reduce downtime. Of course, there is a single network link being shared by all threads. This link can become a bottleneck as the number of threads becomes very large.
13. In the text, we described a multithreaded Web server, showing why it is better than asingle-threaded server and a finite-state machine server. Are there any circumstances inwhich a single-threaded server might be better? Give an example.
13. Yes. If the server is entirely CPU bound, there is no need to have multiple threads. It just adds unnecessary complexity. As an example, consider a tele- phone directory assistance number (like 555-1212) for an area with 1 million people. If each (name, telephone number) record is, say, 64 characters, the en- tire database takes 64 megabytes and can easily be kept in the server"s memory to provide fast lookup.
15. Why would a thread ever voluntarily give up the CPU by calling thread yield? Afterall, since there is no periodic clock interrupt, it may never get the CPU back.
15. Threads in a process cooperate. They are not hostile to one another. If yield- ing is needed for the good of the application, then a thread will yield. After all, it is usually the same programmer who writes the code for all of them.
44. Five jobs are waiting to be run. Their expected run times are 9, 6, 3, 5, and X. In whatorder should they be run to minimize average response time? (Your answer willdepend on X.)
A process is basically aprogram in execution. Why would anyone want to have a kind of process within a process? It turns out there are several reasons for having these miniprocesses, called threads.
Processes frequently need to communicate with other processes. For example,in a shell pipeline, the output of the first process must be passed to the secondprocess, and so on down the line. Thus there is a need for communication betweenprocesses, preferably in a well-structured way not using interrupts. In the followingsections we will look at some of the issues related to this InterProcess Communication,or IPC.
As a second attempt, let us look for a software solution. Consider having a single,shared (lock) variable, initially 0. When a process wants to enter its critical region,it first tests the lock. If the lock is 0, the process sets it to 1 and enters thecritical region. If the lock is already 1, the process just waits until it becomes 0.Thus, a 0 means that no process is in its critical region, and a 1 means that someprocess is in its critical region.Unfortunately, this idea contains exactly the same fatal flaw that we saw in thespooler directory. Suppose that one process reads the lock and sees that it is 0. Beforeit can set the lock to 1, another process is scheduled, runs, and sets the lock to1. When the first process runs again, it will also set the lock to 1, and two processeswill be in their critical regions at the same time.Now you might think that we could get around this problem by first readingout the lock value, then checking it again just before storing into it, but that reallydoes not help. The race now occurs if the second process modifies the lock justafter the first process has finished its second check.
Put differently, taking turns is not a good idea whenone of the processes is much slower than the other.
(Test and Set Lock) that works as follows. It reads the contents of the memoryword lock into register RX and then stores a nonzero value at the memory addresslock. The operations of reading the word and storing into it are guaranteed to beindivisible—no other processor can access the memory word until the instruction isfinished. The CPU executing the TSL instruction locks the memory bus to prohibitother CPUs from accessing memory until it is done.
When the I/O has completed, the driver putsthe data (if any) where they are needed and returns. The operating system then returnscontrol to the caller. This method is called busy waiting and has the disadvantageof tying up the CPU polling the device until it is finished.
A mutex is a shared variable that can be in one of two states: unlocked orlocked. Consequently, only 1 bit is required to represent it, but in practice an integeroften is used, with 0 meaning unlocked and all other values meaning locked.
This was the situation in 1965, when E. W. Dijkstra (1965) suggested using aninteger variable to count the number of wakeups saved for future use. In his proposal,a new variable type, which he called a semaphore, was introduced. A semaphorecould have the value 0, indicating that no wakeups were saved, or somepositive value if one or more wakeups were pending.
The separation of mechanism and policy<1> is a design principle in computer science. It states that mechanisms (those parts of a system implementation that control the authorization of operations and the allocation of resources) should not dictate (or overly restrict) the policies according to which decisions are made about which operations to authorize, and which resources to allocate.This is most commonly discussed in the context of security mechanisms (authentication and authorization), but is actually applicable to a much wider range of resource allocation problems (e.g. CPU scheduling, memory allocation, quality of service), and the general question of good object abstraction.Per Brinch Hansen introduced the concept of separation of policy and mechanism in operating systems in the RC 4000 multiprogramming system.<2> Artsy and Livny, in a 1987 paper, discussed an approach for an operating system design having an "extreme separation of mechanism and policy".

See more: How To Make A Microphone Stand For Cheap, How To Make A Microphone Stand Using A Tripod

<3><4> In a 2000 article, Chervenak et al. described the principles of mechanism neutrality and policy neutrality
A real-time system is one in which time plays an essential role. Typically, oneor more physical devices external to the computer generate stimuli, and the computermust react appropriately to them within a fixed amount of time. For example,the computer in a compact disc player gets the bits as they come off the drive andmust convert them into music within a very tight time interval. If the calculationtakes too long, the music will sound peculiar. Other real-time systems are patientmonitoring in a hospital intensive-care unit, the autopilot in an aircraft, and robotcontrol in an automated factory. In all these cases, having the right answer buthaving it too late is often just as bad as not having it at all.Real-time systems are generally categorized as hard real time, meaning thereare absolute deadlines that must be met—or else!— and soft real time, meaningthat missing an occasional deadline is undesirable, but nevertheless tolerable. Inboth cases, real-time behavior is achieved by dividing the program into a numberof processes, each of whose behavior is predictable and known in advance. Theseprocesses are generally short lived and can run to completion in well under a second.When an external event is detected, it is the job of the scheduler to schedulethe processes in such a way that all deadlines are met.

Computer Organization and Design MIPS Edition: The Hardware/Software Interface5th EditionDavid A. Patterson, John L. Hennessy

Introduction to Algorithms3rd EditionCharles E. Leiserson, Clifford Stein, Ronald L. Rivest, Thomas H. Cormen


Problem Solving and Programming Concepts9th EditionJim Hubbard, Maureen Sprankle
244 explanations
Sets found in the same folder
{<"productClickLinkData"> = <{"name":"OS A1","id":"13084364","price":"","category":"premium content","variant":"study guide","position":"","brand":"googlemania"}>; QLoad(""); return;}})}else{<"productClickLinkData"> = <{"name":"OS A1","id":"13084364","price":"","category":"premium content","variant":"study guide","position":"","brand":"googlemania"}>; QLoad(""); return;;window.location.assign("");}" id="1-13084364">
6 terms
{<"productClickLinkData"> = <{"name":"CS570 Summer 2016 CH.1","id":"141674748","price":"","category":"premium content","variant":"study guide","position":"","brand":"f777medina"}>; QLoad(""); return;}})}else{<"productClickLinkData"> = <{"name":"CS570 Summer 2016 CH.1","id":"141674748","price":"","category":"premium content","variant":"study guide","position":"","brand":"f777medina"}>; QLoad(""); return;;window.location.assign("");}" id="1-141674748">
CS570 Summer 2016 CH.1
40 terms
{<"productClickLinkData"> = <{"name":"chapter 2 solutions","id":"162236860","price":"","category":"premium content","variant":"study guide","position":"","brand":"haley_danylchuk"}>; QLoad(""); return;}})}else{<"productClickLinkData"> = <{"name":"chapter 2 solutions","id":"162236860","price":"","category":"premium content","variant":"study guide","position":"","brand":"haley_danylchuk"}>; QLoad(""); return;;window.location.assign("");}" id="1-162236860">
chapter 2 solutions
21 terms
{<"productClickLinkData"> = <{"name":"CS 360 Unit 1","id":"228629828","price":"","category":"premium content","variant":"study guide","position":"","brand":"ben_mason79"}>; QLoad(""); return;}})}else{<"productClickLinkData"> = <{"name":"CS 360 Unit 1","id":"228629828","price":"","category":"premium content","variant":"study guide","position":"","brand":"ben_mason79"}>; QLoad(""); return;;window.location.assign("");}" id="1-228629828">