Page 113 - DCAP103_Principle of operating system
P. 113

Principles of Operating Systems



                   Notes            7.  Consider multi-processor system and a multi-threaded program written using the many-
                                      to-many threading model. Let the number of user-level threads in the program be more
                                      than the number of processors in the system. Discuss the performance implications of the
                                      following scenarios.

                                      (a)  The number of kernel threads allocated to the program is less than the number of
                                         processors.
                                      (b)  The  number  of  kernel  threads  allocated  to  the  program  is  equal  to  the  number  of
                                         processors.
                                      (c)  The number of kernel threads allocated to the program is greater than the number of
                                         processors but less than the number of user level threads.
                                    8.  Write a multi-threaded Java, Pthreads, or Win32 program that outputs prime numbers.
                                      This program should work as follows: The user will run the program and will enter a
                                      number on the command line. The program will then create a separate thread that outputs
                                      all the prime numbers less than or equal to the number entered by the user.
                                    9.  Why is it important for the scheduler to distinguish I/O-bound programs from CPU-bound
                                      programs?

                                   10.  Discuss how the following pairs of scheduling criteria conflict in certain settings.
                                      (a)  CPU utilization and response time
                                      (b)  Average turnaround time and maximum waiting time

                                      (c)  I/O device utilization and CPU utilization
                                   11.  Which of the following scheduling algorithms could result in starvation?
                                      (a)  First-come, first-served
                                      (b)  Shortest job first

                                      (c)  Round robin
                                   12.  Consider  a  system  implementing  multilevel  queue  scheduling.  What  strategy  can  a
                                      computer user employ to maximize the amount of CPU time allocated to the user’s process?
                                   13.  Explain the differences in the degree to which the following scheduling algorithms
                                      discriminate in favor of short processes:
                                      (a)  FCFS
                                      (b)  RR

                                      (c)  Multilevel feedback queues
                                   14.  Using the Windows XP scheduling algorithm, what is the numeric priority of a thread for
                                      the following scenarios?

                                      (a)  A thread in the REALTIME PRIORITY CLASS with a relative priority of HIGHEST.
                                      (b)  A thread in the NORMAL PRIORITY CLASS with a relative priority of NORMAL.
                                      (c)  A thread in the HIGH PRIORITY CLASS with a relative priority of ABOVE NORMAL.

                                   15.  Consider the scheduling algorithm in the Solaris operating system for time sharing threads:
                                      (a)  What is the time quantum (in milliseconds) for a thread with priority 10? With priority
                                         55?






        106                               LOVELY PROFESSIONAL UNIVERSITY
   108   109   110   111   112   113   114   115   116   117   118