exer1-ans

3
<Exercise 1> Due date: March 24, 11:59 P.M. (아래와 비슷한 내용을 포함하고 있으면 크게 점수 깍지 않을 것입니다.) 1. What is spooi!"# Do $ou thi!% that ad&a!ced perso!a co'puters i ha&e spooi!" as a sta!dard eature i! the uture# (5 poi!ts)  Input spooling is the technique of reading in jobs, for example, from cards, onto the disk, so that when the currently executing processes are finished, there will be work waiting for the CPU. utput spooling consists of first copying printable files to disk before printing them, rather than printing directly as the output is generated. Input spooling on a personal computer is not !ery likely, but output spooling is. 2. What is the purpose o i!terrupts# What are the diere!ces *etee ! a trap a!d a! i!terrupt# +a! traps *e "e!erated i!te!tio!a$ *$ a user pro"ra'# so, or hat purpose# (- poi!ts)  "n interrupt is a hardware#generated change of flow within the system. "n interrupt handler is called to deal with the cause of the interrupt$ control is then returned to the interrupted context and instruction. " trap is a software#generated interrupt. "n interrupt can be used to signal the completion of an I% to ob!iate the need for de!ice polling. " trap can be generated intentionally by a user program. It can be u sed to call operating system routines or to catch arithmetic errors. . Dei!e the esse!tia properties o the ooi!" t$pes o operati!" s$ste's: (1/ poi!ts) a. 0atch &obs with similar needs are batched together and run through the computer as a group by an operator or automatic job sequencer. Performance is increased by attempting to keep CPU and I% de!ices busy at all times through buffering, off#line operation, spooling, and multiprogramming. 'atch is good for executing large jobs that need little interaction$ they can be submitted and picked up later. *. i'e shari!" (his system uses CPU scheduling and multiprogramming to pro!ide economical interacti!e use of a system. (he CPU switches rapidly from one user to another. Instead of ha!ing a job defined by spooled card images, each program reads its next control card from the terminal, and output is normally printed immediately to the screen. c. ea ti'e ften used in a dedicated application, this system re ads information from sensors and must respond within a fixed amount of time to ensure correct performance. d. Parae Parallel operating systems are the interface between parallel computers )or

Upload: abdelrahman-elattar

Post on 02-Jun-2018

219 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: exer1-ans

8/10/2019 exer1-ans

http://slidepdf.com/reader/full/exer1-ans 1/3

<Exercise 1>

Due date: March 24, 11:59 P.M.

(아래와 비슷한 내용을 포함하고 있으면 크게 점수 깍지 않을 것입니다.)

1. What is spooi!"# Do $ou thi!% that ad&a!ced perso!a co'puters i ha&e spooi!" as a sta!dard eature

i! the uture# (5 poi!ts)

  Input spooling is the technique of reading in jobs, for example, from cards, onto the disk, so

that when the currently executing processes are finished, there will be work waiting for the CPU.

utput spooling consists of first copying printable files to disk before printing them, rather than

printing directly as the output is generated. Input spooling on a personal computer is not !ery

likely, but output spooling is.

2. What is the purpose o i!terrupts# What are the diere!ces *etee! a trap a!d a! i!terrupt# +a! traps *e

"e!erated i!te!tio!a$ *$ a user pro"ra'# so, or hat purpose# (- poi!ts)

  "n interrupt is a hardware#generated change of flow within the system. "n interrupt handler is

called to deal with the cause of the interrupt$ control is then returned to the interrupted context

and instruction. " trap is a software#generated interrupt. "n interrupt can be used to signal the

completion of an I% to ob!iate the need for de!ice polling. " trap can be generated intentionally

by a user program. It can be used to call operating system routines or to catch arithmetic errors.

. Dei!e the esse!tia properties o the ooi!" t$pes o operati!" s$ste's: (1/ poi!ts)

a. 0atch &obs with similar needs are batched together and run through the computer as a

group by an operator or automatic job sequencer. Performance is increased by attempting to

keep CPU and I% de!ices busy at all times through buffering, off#line operation, spooling, and

multiprogramming. 'atch is good for executing large jobs that need little interaction$ they can be

submitted and picked up later.

*. i'e shari!" (his system uses CPU scheduling and multiprogramming to pro!ide

economical interacti!e use of a system. (he CPU switches rapidly from one user to another.

Instead of ha!ing a job defined by spooled card images, each program reads its next control

card from the terminal, and output is normally printed immediately to the screen.

c. ea ti'e ften used in a dedicated application, this system reads information from sensors

and must respond within a fixed amount of time to ensure correct performance.

d. Parae Parallel operating systems are the interface between parallel computers )or

Page 2: exer1-ans

8/10/2019 exer1-ans

http://slidepdf.com/reader/full/exer1-ans 2/3

computer systems* and the applications )parallel or not* that are executed on them. Parallel

operating systems are primarily concerned with managing the resources of parallel machines.

(his task faces many challenges+ )a* application programmers demand all the performance

possible, )b* additionally, there is some )mostly experimental* work done towards the

exploitation of the shared memory paradigm on top of networks of workstations or personal

computers.

e. Distri*uted (his system distributes computation among se!eral physical processors. (he

processors do not share memory or a clock. Instead, each processor has its own local memory.

(hey communicate with each other through !arious communication lines, such as a high#speed

bus or local area network.

4. 3i&e to reaso!s h$ caches (i! 'e'or$) are useu. What pro*e's do the$ so&e# What pro*e's do

the$ cause# a cache ca! *e 'ade as ar"e as the de&ice or hich it is cachi!" (or i!sta!ce, a cache as

ar"e as a dis%), h$ !ot 'a%e it that ar"e a!d ei'i!ate the de&ice# (- poi!ts)

  Caches are useful when two or more components need to exchange data, and the

components perform transfers at differing speeds. Caches sol!e the transfer problem by

pro!iding a buffer of intermediate speed between the components. If the fast de!ice finds the

data it needs in the cache, it need not wait for the slower de!ice. (he data in the cache must be

kept consistent with the data in the components. If a component has a data !alue change, and

the datum is also in the cache, the cache must also be updated. (his is especially a problem on

multiprocessor systems where more than one process may be accessing a datum. " component

may be eliminated by an equal#sied cache, but only if+ )a* the cache and the component ha!e

equi!alent state#sa!ing capacity )that is, if the component retains its data when electricity is

remo!ed, the cache must retain data as well*, and )b* the cache is affordable, because faster

storage tends to be more expensi!e.

5. ! i". 21/, a 'utithreaded We* ser&er is sho!. the o!$ a$ to read ro' a ie is the !or'a *oc%i!"

read s$ste' ca, do $ou thi!% usere&e threads or %er!ee&e threads are *ei!" used or the We* ser&er#

Wh$# (5 poi!ts)

  " worker thread will block when it has to read a -eb page from the disk. If user#le!el threads

are being used, this action will block the entire process, destroying the !alue of multithreading.

(hus it is essential that kernel threads are used to permit some threads to block without

affecting the others.

6. Which o the ooi!" co'po!e!ts o pro"ra' state are shared across threads i! a 'utithreaded

Page 3: exer1-ans

8/10/2019 exer1-ans

http://slidepdf.com/reader/full/exer1-ans 3/3

process# (4 poi!ts)

a. e"ister &aues

*. 7eap 'e'or$

c. 3o*a &aria*es

d. 8tac% 'e'or$

  (he threads of a multithreaded process share heap memory and global !ariables. ach thread

has its separate set of register !alues and a separate stack.