Sei sulla pagina 1di 5

CST 232

Operating Systems
Test 2, Semester 1, 201512016 (75 minutes)

ll\hn L\r fhq W4I (rr$vtJ

Name (Matric #):
. This test consists of 3 questions. You are required to answer all questions.

Totai marks are 100 marks for the test. This test contributes 10 o/o towards your grade.

Partial marks may be given for your working even though the final answer is incorrect.

Question Marks


1. (a) Tick 1y'; ttre correct answer TRUE or FALSE

i. In a loosely coupled muitiprocessing configuration, the processors share

" access to main memory.

ii. In a Readers and Writers process cooperation scheme, there is no need for
any critical section if there is only one writer and multiple readers.


By using additional processors, we can always reduce the amount of time
taken to solve anv task based on 1/(No. of CPU

For movable head disk drives, the main delay component is due to the track
seek time.

v. RAID is well suited as a data backup scheme for the enterprise.

(b) On a
(10 marks)

multiprocessor system with 4 frrocessnrs, and 10_p1s!g$es that need access to a shared
ypury3. Given that the process context switching time is;L$U,rwhile the time each process
spends in the critical section is l3_s., answer the following questions:

CST 232

used by fypical
operating systems'
r -

justifu your answer'
memory area? Please

{& ^4
(iii) lf the time spenr by
each process
':*:_":"::.,." i'stifv your

:Jffi; fi; *o'oo" more erncient?


*'*ollaoal "t"
A*0}'uru -1h-'
o^l.t vr*u[/t-
( *e +o" {(sLa!
',"'cvr.tlr^\ gc,kn /--
(i6 marks)

Read data from buffer
Write data into buffer

Consume data
CST 232

(i) What are the three variablesfull, empty and mutex used for? What should be the initial
values for these variables?

t - r

/ u
.-klt\ :s \L\ei\ Rro,fn lrolrttl and. *or ntty.u
tni\+t<c \ .

\.r\\-_ tn
e,al.trf e_ 0 V
il"*k-_ o /\
(ii) Explain what happens if the initial value for emplt is 1. Will the system work properly for
the case where both the producer and consumer processes perform theirtask in 5 seconds while

.'the producer generates one output every 20 seconds? Justifo your answe
Ii"5;i1ilrH trW'i*' :ry HJ,#r
r;,ffi 4,u
*tr'W' H 't,,,,!'^-r,/r* Nd
Con}.t,yttlt ,
(12 marks)

2. A magnetic tape drive is used to store data for long term archiving.
(a) State two (2) advantages of using magnetic tape as an archiving storage medium

- fi't- nt$a/-tzc (Lvrnx +L Ao*a fass ?/1

ulrl uy"
n^0 (y\+,n!
laqL fl?A ,/ (4 marks)

(b) A database file 1 GByte in size containing 5!,!._0,r9co:4l,needs to be stored to tape for later

processing. State three (3) disadvantages for storing the file as a single data stream written

continuously to tape (i.e., without any gaps between records) compared to writing data grouped
into 100 records per group as separate blocks on the tape.

->l- "rrtr fitfrcuft tt *ra,

CST 232

(c) A movable head disk drive has 10.0 tracks, numbered as Track 0 to Track 99. Given that the

following track requests are passed to the Drive Manager at the beginning, and the currglt head is

on TBghA determine the track servicing seqaence and total number of tracks traveled using the

Shortest Seek Time Firpt (SSTF) algorithm:

'l Al ,-. d
{a 62,,7 46, \s ! } . e3 , 87

3 6 \, t. L? tL .ai
/vA,,A tWuYb/+/Y

1,tt NltuWr of tact; *r^vrPl = 3ts Wq+q+{L+lr+L


(18 marks)

\q. 3 (a) An Address Book program needs to store 10,000 variable length data items in a file. Given that
9 *dvarrl\Y-', the file system can supporr either store q{gg4$gp.ds or variable-length records, answer
Con the following questions:
- thr- 'frlel andtwo (2) disadvantages orstoringthe variabre
ffi .ryr* ;:",.;ff i.ff*"
N,#WW #yy 9'6{"rf i\L Io*+*r,

,rt- lA.^q4
r- \hl, I - ' / file system as variable iength records, explain one (1) method in which random searches can be
-r\ tT( / performed without having to access each record in the file in sequence.

sry lr- Jo,tu

(i0 marks)
CST 232

/ Syclv-o|;za&'4
l'\Ser lttnW
t o*ty *r?D

with 100 users and 3,000 files, which of the above approaches
(ii) Given a computer system

be suitable? Justify your answer(s)'

CJch ror,rno*loq ' {h*s lAcartg^- i( C"il

*-u\\ cu^{'s\
.^[ "M"^l
\lth /v\0r[- +'kr

(12 marks)

amount of storage space needed

(c) The following data needs to be compressed to reduce the

on the disk. Determine if the compression technique

used is suitabie or unsuitable by

marking the correct column with a '

Compression Format Suitable Unsuitable
Type of File

(i) Program Debug Run Length Encoding (RLE)


(ii) Executable Program MPEG


(iii) Music Fiie AAC


(iv) Database records of JPEG

photo album apP

(v) Digital PhotograPh Portable Network GraPhics

(PNG) \/ /)
(vi) Word-processor Lempel-Ziv-Welch (LZW)
(12 marks)