Você está na página 1de 8

Home Work Operating System (CSE 367)

Submitted By :

Submitted To : r! Sandeep "an#an

"o$it "o%% &o! ' (6 Se)tion ' *+",, "egd &o! ' ++(((--6

.uestion &o!+:/ 0ns1er: / At present time multithreading programs are created which are faster and accurate
then single threaded programs. Yet there are some problems which can be solved using single thread rather than multithreading in programming.

The problems having sequential solutions can be solved by single threaded processes in a better way, in these type of processes there is no need for multithreading as one process can complete the whole solution. For example: !laying the chess: as the only one step is occurred at a instant of time. "alculating the n# : that is factorial of n numbers as next calculation can be done $ust after the previous and single at the time. For input output more than one thread doing the tas% for same device.

.uestion &o!,: 0ns1er:/A scheduler always distinguish between &'( bound and "!) bound programs as both
of these have very different properties in terms of computation methods , "!) usage and types of inputs, as describes below: 23O Bound 4rograms These have little computation during execution. These have a large number of &nput operators. These do not use their "!) quantum C45 Bound 4rograms These have very high level of computation processes. These have very few inputs operations.

These use their CPU quantum

*ue to these above difference between &'( and "!) bound programs scheduler always distinguish between these two.

.uestion &o!3: 0ns1er: /


Process !+ !, !Burst Time ,+ .

/antt chart using 01F scheduling:

4,
2 -+

43
-

4+
+2

3aiting time for !+ 4 +2 3aiting time for !, 4 2 3aiting time for !+ 4 5ow average waiting time is 4 6+27-728'- 4 9.-- units

.uestion &o!6:/ 0ns1er: /


Threads The traditional processes performs only one tas% at a time: to resolve this problem multithreading has been started in the programming. A thread is created to perform multiple tas%s at a time. &t consists of Thread &*, !rogram "ounter, a ;egister 0et, and a 0tac%.

Common T$reading

ode%s '

+. <any=to one: This model maps many user level threads to one %ernel thread.

<any to one <odel ,. (ne to one <odel: This model maps each user thread to the %ernel thread. &t provides more concurrency than many to one model.

(ne to one <odel

-. <any to many <odel: &t multiplexes many users =level threads to a smaller or equal no. of %ernel threads.

<any to many <odel

.uestion &o!-:/ 0ns1er:/


Processes P1 P2 P3 P4 Burst Time 10 8 9 4 Priority 2 4 1 3

5sing 7C7S: !+ 2 !, +2 !+> !9 ,. -+

Turn 0round Time: !+4 +2 !,4+> !-4,. !94-+

Waiting time: P1= 0, P2 = 10, P3 = 18, P4 = 27

Avg 3aiting Time4 627+27+>7,+8'9 4 +-..? units

5sing S87: !9 2 9 !, +, !,+ !+ -+

Turn 0round Time: !+4-+ !,4+, !-4,+ !949

Avg Waiting time 4

62797+,7,+8'9 4 @.,? units

5sing a &on/4rempti9e 4riority :

!2

!+ @

!9 +@

!, ,-+

Turn 0round Time: !+4+@ !,4-+ !-4@ !94,09g Waiting Time4 627@7+@7,-8'9 4 +,..? units

Using Round Robin (Quantum No. = 2) : P 0 24 2 P2 2 28 P! P" P P2 8 P! P" 10 P 12 P2 P! 14 P 1 P2 18 P! P 20 P ! 22

4 30 31

Turn around time : !+ 4 -2 !, 4 ,A !- 4 -+ !9 4 +A

09erage Waiting Time : 6,27+>7,,7+,8'9 4 +> units

.uestion &o!6: 0ns1er: /

a). &n time sharing and multiprogramming environment , several user share the system. This situation can result in to various security problems , two of these are : +. "opying or stealing oneBs program or data by other user on same system. ,. using system resources e.g. "!),memory,dis% space, peripherals with improper accounting

b)! 5o, it is not possible to gain same degree of security for time shared machine as that of dedicated machine. As a dedicated machine is used by a single user so there are no chance of copying or stealing issues. &n case of time shared if you put any security in your system , it is possible that it can be crac%ed by another user causing a 0ecurity Threat.

Você também pode gostar