Wednesday, December 4, 2019

Formal Models of Operating System Kernels

Questions: 1. An operating system that does not support multithreading cannot simultaneously utilize multiple processors (CPUs).Do you agree? Please provide reason(s) to support your answer.2. A process that is waiting for access to a critical section does not consume CPU time.Do you agree? Please provide reason(s) to support your answer.3. Windows 8 Thread can be in one of has 6 states (Figure 4.11 on Textbook page 76); whereas UNIX/Solaris Thread can be in one of 8 states? Answers: 1. Yes, I agree with the statement that an operating system that does not support multithreading cannot simultaneously utilize multiple processors (CPUs). In case of an operating system that supports multi-threading, threads from same of different processes can run simultaneously on the kernel. The programs are designed in such a way that the execution of no two threads interfere one another. A multi-processor system will have more than one processor. It is up to the OS, that all CPUs are utilized simultaneously or not. OS interacts with the hardware through kernel. Thus the kernel need to support simultaneous execution or more than one thread. If the OS does not support multi-threading, then at a time the kernel will be accessed by one thread or process only. Even there is multiple CPUs, at a time, only one will be used. So, it is true that the operating system needs to support multithreading to utilize multiple CPUs simultaneously. 2. No, I dont agree with the statement A process that is waiting for access to a critical section does not consume CPU time. A critical section is the section in the code of a program that contains shared information. Thus two or more process can try to access critical section at a time. But to avoid discrepancies, no two process will have simultaneous access to critical section. One have to wait for another two complete its execution. Now, there are different time to optimize this waiting time. In general, when a process is waiting to enter into some critical section, then the process is checking continuously that whether the critical section is available or not. This process is called busy waiting. It consumes CPU time. Ant this CPU time is just wastage. There are other mechanisms that optimizes these busy waiting. For example, blocking the waiting processes for some time, refrains those from continuous checking of the availability of the critical section and saves CPU time. Thus, it is not true that a waiting process does not consume CPU time while waiting for the critical section. 3. A ZOMBIE process is common in UNIX and LINUX OS based systems. It is a process that has been terminated by calling EXIT function call but the OS has kept information about the process in the process table. This is true for the child processes. The parent process wants to have some information about the exit status of its child. Thus the OS keeps information about the terminated child processes. Such processes are in Terminated state. When the parent process of the ZOMBIE process reads the exit status of the ZOMBIE child process, then the OS reaps out the information about the ZOMBIE process from its process table. So, a terminated child process will be in ZOMBIE state as long as its parent does not read the exit status as requested. So, in UNIX and LINUX process has 8 states including ZOMBIE state. If there is a ZOMBIE process in a system for quiet longer period then there may be system errors and resource leakages. ZOMBIE processes are different than other processes. Thus the KILL command cannot delete it from the system process table. In case of Windows 8, a buggy driver will be there from a ZOMBIE process. To deal with the errors and issues related to ZOMBIE process, the OS cleans the ZOMBIE processes from the system automatically. Thus there is no need to add some explicit state for ZOMBIE process. References Craig, I. D. (2007). Formal Models of Operating System Kernels. Springer. Deitel. (2004). Operating System. Pearson. Fox, R. (2015). Linux with Operating System Concepts. CRC Press. Godbole. (2011). Operating System. McGraw-Hill. Haldar, S., Aravind, A. A. (2010). Operating Systems. Pearson. Naghibzadeh, M. (2005). Operating System. iUniverse. Silberschatz, A., Galvin, B. B., Gagne, G. (2013). Operating System Concepts. Addison-Wesley. Sosinsky, B. (2012). Windows 8. Peachpit Press. Stallings, W. (2012). Operating Systems: Internals and Design Principles. Prentice Hall.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.