[Answer]
[Answer]
Describe the difference between symmetric and asymmetric multiprocessing. What are the advantages and disadvantages of multiprocessor systems?
[Answer]
Symmetric multiprocessing treats all processors as equals, and I/O can be
processed on any CPU. Asymmetric multiprocessing has one master CPU and the
remainder CPUs are slaves. The master distributes tasks among the slaves, and
I/O is usually done by the master only.
Multiprocessors can save money, by not duplicating power supplies, housings,
and peripherals. They can execute programs more quickly, and can have increased
reliability. They are also more complex in both hardware and software than
uni-processor systems.
What is the main advantage of multiprogramming? At any given time, the CPU executes a single process, how does multiprogramming improve CPU utilization? what is the difference between multiprogramming and multiprocessing?
[Answer]
Multiprogramming makes efficient use of the CPU by overlapping the demands for
the CPU and its I/O devices from various users. It attempts to increase CPU
utilization by always having something for the CPU to execute.
In a multiprogramming system, the operating system organizes jobs in such a way
that the CPU is never idle. If one job, is waiting for some I/O task to
complete, the CPU will switch over to next job instead of sitting idle.
Thus, even if only one job executes at a time, CPU utilization is obtained
by keeping the CPU busy at all times.
In multiprogramming, several programs are in memory concurrently; the system
switches among the programs for efficient processing, and minimal idle time.
Multiprocessing is related to multiprocessor systems which have two or more
processors in close communication, sharing the computer bus and the clock.
A computer has a cache, main memory, and a disk. If a word is in the cache, 8 ns are required to access it. If it is in main memory, but not in cache, 70 ns are needed to load it into the cache. and then the reference is started again. If the word is not in main memory, 8 milliseconds (1 millisecond = 10^6 ns) are required to fetch it from disk, followed by 70 ns to get it into the cache. If the cache hit ratio is 0.6, and the main memory hit ratio is 0.8, what is the average access time? You must show how you arrived at your answer. If you just write down your final answer, you will not receive any credit.
[Answer]
Ta = total access time
Hc = cache hit ratio
Tc = Time to access cache
Hm = main memory hit ratio
Tm = Time to load data into the cache from main memory
Td = Time to load data into the cache from disk
Hc = 0.6; Hm = 0.8;
Tc = 8ns; Tm = 70ns; Td = 8ms;
Case 1: the word is in the cache: Hc*Tc
Case 2: the word is not in cache, but in memory: (1-Hc)*Hm*(Tc+Tm)
Case 3: the word is not in cache, not in memory, but on disk: (1-Hc)*(1-Hm)*( Tc+Tm+Td)
Ta = Case 1 + Case 2 + Case 3
= Hc*Tc + (1-Hc)*Hm*(Tc+Tm) + (1-Hc)*(1-Hm)*( Tc+Tm+Td)
= Tc + (1-Hc)*Tm + (1-Hc)*(1-Hm)*Td
= 8 + (1-0.6)*70 + (1-0.6)*(1-0.8)*8*10^6
= 640036 ns
What are virtual machines? Explain the relationship between the Java programming language and the virtual machine concept.
[Answer]
Some systems are designed as a sequence of layers.
The virtual machine concept takes the layered approach and treats both the
kernel of the operating system and the hardware as if they were all hardware.
Even other operating systems may be loaded on top of this virtual machine.
All Java programs can be run on any operating system that implemented the Java
Virtual Machine, because the JVM abstracts the underlying system to the Java
program, providing an architecture-neutral interface.
A main memory system consists of a number of memory modules attached to the system bus. When a write request is made, the bus is occupied for 100 nanoseconds (ns) by the data, address, and control signals. During the same 100 ns, and for 500 ns thereafter, the addressed memory module executes one cycle accepting and storing the data. The operation of the memory modules may overlap, but only one request can be on the bus at any time. Assume that there are eight such modules connected to the bus. What is the maximum possible rate (in words per second) at which data can be stored? Explain you answer.
[Answer]
Each request takes 100ns on the bus, followed by another 500ns to complete the
operations. The bus is free after the first 100ns of the request.
Therefore 6 modules can be addressed in 600ns after which the first module will
be completing the operation. Therefore we have enough modules to handle the
peak transfer rate of the bus. The peak transfer rate would therefore be the
same as that of the bus i.e, 10^9/100 = 10^7 requests per second.
We can ignore the 5 incomplete requests.
Writing an operating system that can operate without interference from malicious or undebugged user programs requires some hardware assistance. Describe three hardware tools used in computers as protection mechanisms.
[Answer] These three hardware tools are dual-mode, timer and main memory protection.
The dual mode of operation provides a mechanism for protecting the operating
system from errant users - and errant users from one another. This protection
is accomplished by designating some of the instructions that may cause harm
as privileged instructions. The hardware allows privileged instructions to
be executed only in kernel mode. Users execute in user-mode.
Timer management is one of the privileged instructions.
A timer is set by the OS before any user program is allowed to execute.
When the timer expires, the OS takes control of the CPU.
Memory protection is handled by the base and bound register. The values of these
registers are set by the OS before allowing a program to execute. The executing
program can only access memory within the base and bound limits.
Answer the following questions about distributed systems:
[Answer]
We have stressed the need for an operating system to make efficient use of the computing hardware. When is it appropriate for the operating system to forsake this principle and to "waste" resources? Why is such a system not really wasteful?
[Answer]
Single-user systems should maximize use of the system for the user. A GUI might
"waste" CPU cycles but it optimizes the user's interaction with the system.
What are the differences between a trap and an interrupt? Can traps be generated intentionally by a user program? Explain.
[Answer]
An interrupt
is a hardware generated change-of-flow within the system, while a trap is a
software-generated interrupt. An interrupt can be used to signal the completion
of an I/O to obviate the need for device polling. A trap can be used to call
operating system routines or to catch arithmetic errors.
Of course
traps can be generated by a user program since traps are created by a software
and a software is a program written by a user. For example, dividing a number by
0 will cause a trap.
Return to the CS 620 Home Page