Professional Documents
Culture Documents
and 125KB(in order), how would the first-fit, best-fit, and worst-fit
use memory.
Ans:
a. First-fit:
b. 115 KB is put in 300 KB partition, leaving (185 KB, 600 KB, 350 KB,200 KB, 750 KB, 125 KB)
c. 500 KB is put in 600 KB partition, leaving (185 KB, 100 KB, 350 KB,200 KB, 750 KB, 125 KB)
d. 358 KB is put in 750 KB partition, leaving (185 KB, 100 KB, 350 KB,200 KB, 392 KB, 125 KB)
e. 200 KB is put in 350 KB partition, leaving (185 KB, 100 KB, 150 KB,200 KB, 392 KB, 125 KB)
f. 375 KB is put in 392 KB partition, leaving (185 KB, 100 KB, 150 KB,200 KB, 17 KB, 125 KB)
g. Best-fit:
h. 115 KB is put in 125 KB partition, leaving (300 KB, 600 KB, 350 KB,200 KB, 750 KB, 10 KB)
i. 500 KB is put in 600 KB partition, leaving (300 KB, 100 KB, 350 KB,200 KB, 750 KB, 10 KB)
j. 358 KB is put in 750 KB partition, leaving (300 KB, 100 KB, 350 KB,200 KB, 392 KB, 10 KB)
k. 200 KB is put in 200 KB partition, leaving (300 KB, 100 KB, 350 KB, 0KB, 392 KB, 10 KB)
l. 375 KB is put in 392 KB partition, leaving (300 KB, 100 KB, 350 KB, 0KB, 17 KB, 10 KB)
m. Worst-fit:
n. 115 KB is put in 750 KB partition, leaving (300 KB, 600 KB, 350 KB,200 KB, 635 KB, 125 KB)
o. 500 KB is put in 635 KB partition, leaving (300 KB, 600 KB, 350 KB,200 KB, 135 KB, 125 KB)
p. 358 KB is put in 600 KB partition, leaving (300 KB, 242 KB, 350 KB,200 KB, 135 KB, 125 KB)
q. 200 KB is put in 350 KB partition, leaving (300 KB, 242 KB, 150 KB,200 KB, 135 KB, 125 KB)
r. 375 KB must waitIn this example, only worst-fit does not allow a request to be satisfied.An argument could
be made that best-fit is most efficient as it leaves thelargest holes after allocation. However, best-fit runs at
time O(n) and first-fit runs in constant time O(1).
Answer:
Answer:
There are three reasons: First is that these mobile devices typically use
flash memory with limited capacity and swapping is avoided because of
this space constraint. Second, flash memory can support a limited
number of write operations before it becomes less reliable. Lastly,
there is typically poor throughput betweenmainmemory and flash
memory.
Answer:
8.28 Consider the following segment table:
0219600
1230014
290100
31327580
4195296
What are the physical addresses for the following logical addresses?
a.0,430
b.1,10
c.2,500
d.3,400
e.4,112
Answer :
b. 2300 + 10 = 2310
microsecond to access a page other than the current one. Pages have
1,000 words, and the paging device is a drum that rotates at 3,000
revolutions per minute and transfers 1 million words per second. The
following statistical measurements were obtained from the system:
•One percent of all instructions executed accessed a page other than the
current page.
•When a new page was required, the replaced page was modified 50
percent of the time. Calculate the effective instruction time on this
system, assuming that the system is running one process only and that
the processor is idle during drum transfers.
Answer:
a.When a process first starts execution, how would you characterize the
page-fault rate?
b.Once the working set for a process is loaded into memory, how would
you characterize the page-fault rate?
c.Assume that a process changes its locality and the size of the new
will be very high because none of the pages that the process
will be low.
b. If the working set is in memory, the page fault rate will be 0%.
available.
system.
any more frames to it. The process will have a very high
page fault rate and will appear to execute very slowly, but
a.When a process first starts execution, how would you characterize the
page-fault rate?
b.Once the working set for a process is loaded into memory, how would
you characterize the page-fault rate?
Ready
Blocked Running
c.Assume that a process changes its locality and the size of the new
Answer
9.22 The page table shown in Figure 9.32 is for a system with 16-bit
virtual and physical addresses and with 4,096-byte pages. The reference
bit is set to 1 when the page has been referenced. Periodically, a thread
zeroes out all values of the reference bit. A dash for a page frame
indicates the page is not in memory. The page-replacement algorithm is
localized LRU, and all numbers are provided in decimal.
090
110
2140
3100
4–0
5130
680
7150
8–0
900
1050
1140
12–0
13–0
1430
1520
hexadecimal or decimal. Also set the reference bit for the appro-
•0xE12C
•0x3A9D
•0xA9D9
•0x7001
•0xACA1
b.Using the above addresses as a guide, provide an example of a logical
address (in hexadecimal) that results in a page fault.
9.32 What is the cause of thrashing? How does the system detect
thrashing? Once it detects thrashing, what can the system do to eliminate
this problem?
Answer:
9.33 Is it possible for a process to have two working sets, one
representing data and another representing code? Explain.
Answer:
10.9 None of the disk-scheduling disciplines, exceptFCFS, is truly fair
(starvation may occur).
Answer:
(a) New requests for the track over which the head currently resides can
theoretically arrive as quickly as these requests are being serviced.
(b) All requests older than some predetermined age could be "forced" to
the top of the queue, and an associated bit for each could be set to indicate
that no new request could be moved ahead of these requests. For SSTF,
the rest of the queue would have to be reorganized with respect to the last
of these "old" requests.
(c) To prevent unusually long response times.
(d) Paging and swapping should take priority over user requests. It may be
desirable for other kernel-initiated I/O, such as the writing of file system
metadata, to take precedence over user I/O. If the kernel supports real-time
process priorities, the I/O requests of those processes should be favored.
Answer:
10.14 Describe some advantages and disadvantages of usingSSDs as a
caching tier and as a disk-drive replacement compared with using only
magnetic disks.
Answer:
10.15 Compare the performance ofC-SCANandSCANscheduling,
assuming a uniform distribution of requests. Consider the average
response time (the time between the arrival of a request and the
completion of that request’s service), the variation in response time, and
the effective bandwidth. How does performance depend on the relative
sizes of seek time and rotational latency?
Answer:
11.11 What are the advantages and disadvantages of providing
mandatory locks instead of advisory locks whose use is left to users’
discretion?
•Random
Answer:
(a) Print the contents of the file. (b) Print the contents of record i. This record can
be found using hashing or index techniques.
Answer :
There would be multiple paths to the same file, which could confuse users or
encourage mistakes (deleting a file with one path deletes the file in all the other
paths).
12.3 Why must the bit map for file allocation be kept on mass storage,
rather than in main memory?
Answer :
In case of system crash (memory failure) the free-space list would not be lost as it
would be if the bit map had been stored in main memory