Escolar Documentos
Profissional Documentos
Cultura Documentos
Submitted By :
"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.
*ue to these above difference between &'( and "!) bound programs scheduler always distinguish between these two.
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
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.
-. <any to many <odel: &t multiplexes many users =level threads to a smaller or equal no. of %ernel threads.
!2
!+ @
!9 +@
!, ,-+
Turn 0round Time: !+4+@ !,4-+ !-4@ !94,09g Waiting Time4 627@7+@7,-8'9 4 +,..? units
4 30 31
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.