Philadelphia University Lecturer: Dr. Nameer N. EL-Emam Internal Examiner: Dr. Raad Alwan Module Name: Adv.Operating System Module Number: 750434 First Exam 12/4/2015 Faculty of Information Technology Department of CS Marking Scheme Semester two 2014-2015 one hour Basic Part Objective: The aim of this part is to check student abilities to understand the basic of DOS. Q1/( 10 marks): Answer the following questions for DOS concepts: 1-What is the meaning of the coherent system? Why it is important in DOS while it is not a substantial concept in another system? Coherent system: A system that can cover all requirements on the global behavior of the target system, such as: Stability, fault-tolerance and failure recovery, concurrency control, commitment, and consistency of replicated data. Every thing in DOS is automatic controlled to cover all processes' demands by transparency (without user, interfering) but in another system, some kind of decisions are taken by users. 2- The main functions in DOS are: a) Governing resources. b) Control., c) Resource/process allocated. Distinguish between them and show why checking the state of resources (idle/busy) is not type of control function? Governing resources : Governing Regulations and Administrative Regulations to manage the system. Resource allocator: Allocate resources (software and hardware) of the computer system and manage them efficiently. Control : Controls execution of user programs and operation of I/O devices. Checking the state of resources (idle/busy) is not a type of control, it implements the resource allocation while control is just make control on execution with out optimization which process is better to execute at the specific time. 3- If transparency has been satisfied in DOS, then explain why the system should be homogeneous. Step1: Let us define the features of transparency = { Access, Location, Migration, Replication, Concurrency, Failure, Persistence}; Step2:If transparency has been satisfied, then the above features should be implemented on homogeneous or heterogeneous: Step3:If features can not be implemented on heterogeneous then It must be implemented on homogeneous Now we should check if the above features can be implemented through a heterogeneous network system or not. Access: Hide how a resource is accessed and where accessing. (Not existed in heterogeneous). Location: Hide where a resource is located (Not existed in heterogeneous). Migrate: It cannot be migrated if heterogeneous systems are used. Replicate: The users cannot tell how many copies exist. (Not existed in heterogeneous). Concurrency: The users cannot tell how many copies exist. (Not existed in heterogeneous). Failure: Hide the recovery the blocked resources by another processor(fault tolerance) (Not implemented in heterogeneous). Persistence: Hide whether a resource (software) is in the memory or on the disk is impossible to implement in heterogeneous 4- Show the difference between micro kernel and monolithic kernel and why uniprocessor system using micro kernel, show what is the main components to make a micro kernel equivalent with monolithic kernel? Monolithic Kernel : All parts of a kernel like the Scheduler, File System, Memory Management, Networking Stacks, Device Drivers, ….etc, are maintained in one unit within the kernel is called Monolithic Kernel Micro Kernal: Includes all system processes that hold very important parts like IPC (Inter process Communication), basic scheduler, basic memory handling, basic I/O primitives etc., are put into the kernel. Communication happens via message passing. Others are maintained as server processes in User Space. To make a micro kernel equivalent with monolithic kernel, we should expand the memory of uni- processor that holds all managements with all services as a master on many slaves. 5- How to extend resource management machine in centralized OS. Why it is not necessary in DOS? In centralized : using virtualization by making computer appears to be more than its real configuration (this is extended resources) // appears to be many processors and appear has a large memory. In DOS: it is not necessary to extend management with new services due to have migration to work stations that have the specific services. Familiar Part Objective: The aim of this part is to check student abilities to understand type of threads in DOS. Q2/( 10 marks): Answer the following questions for the threading concepts: 1- When the library decided to do each of the following function (creating threads, destroying threads, and scheduling threads). o o o Create threads : When we need to define an independent stream of instructions that can be scheduled to run on different processors in parallel. Destroying threads : If thread is completed or problem in thread execution. Scheduling threads: When threads are ready for execution, specific policy should be used to dispatch threads in order to maximize or minimize performance measures. 2- How library create a thread? (Write proposed pseudo code). Step1: Define thread ID; Step2: Specify fixed area to save thread execution context that includes private storage (thread-local storage TLS); Step3: Define signal mask of thread, this mask has two values (blocked, unblocked); Step4: Define the priority of thread; Step5: Define the address of thread’s stack; 3- If library is defined in the user space and one thread has been destroyed, then the size of process that holds this thread has been reduced. So, how the kernel can detect the new size of process? If the rest threads depending on the destroyed thread, how the kernel overcome this problem? Let S is the size of process P, where S is known by kernel. Let P ={T1,T2,…Tm}, where Ti is the ith thread. Then kernel knows address space of process P that is defined in PCB, the space (P) and the size (S) includes m threads. P m Ti ,S m S(T ) i i 1 i 1 If Tm is destroying, then the new size of process NS defined in PCB is equal to: NS m 1 S(T ) i i 1 Then the kernel can detect the new size of process NS, where this new size is define in PCB and the information of PCB is updated by the kernel. If the rest threads depending on the destroyed thread, how the kernel overcome this problem? Due to the dependency, the system kills the process with all threads. 4- LWP does not depend on system resources. Why? The main function of LWP is to support user threads by services/ resources and through this concept we can reduce system overhead instead of calling those services by threads from kernel directly. LWP does not need resource to run its code, but it needs resources/services to transfer them to user because the kernel create LWP for this issue. 5- Why unbound threads model is better than bound threads model with respect to system overhead? Show your answer by one clear example. Bound thread is said to have system contention scope - It contends with all threads in system so if we have n threads then we need to make system call n times. Unbound thread has process contention scope It contends with threads in same process so if we have n threads belong to m processes , where n>m then we need to make m times system call (less than n times).