IDOL Institute of Distance and Online Learning ENHANCE YOUR QUALIFICATION, ADVANCE YOUR CAREER.
M.C.A 2 All right are reserved with CU-IDOL PARALLEL AND DISTRIBUTED COMPUTING Course Code: MCA635 Semester: First SLM Unit : 7 E-Lesson: 7 www.cuidol.in Unit-7 (MCA635)
PROCESS MANAGEMENT 33 OBJECTIVES INTRODUCTION Student will be able to : In this unit we are going to learn about the Define Process Management Process Management . Explain Process Migration And Threads Under this unit you will also understand Describe Code Migration process migration and threads. Able to understand Clients, Servers This Unit will also make us to understand Communication Clients, Servers Communication. Describe various type of Virtualization www.cuidol.in Unit-7 (MCA635) INASllTITriUgThEt aOrFeDreISsTeArNveCdE AwNitDh OCNUL-IIDNOE LLEARNING
TOPICS TO BE COVERED 4 > Introduction to Process Management > Process Migration > Threads > Virtualization > Clients > Servers > Code Migration www.cuidol.in Unit-7 (MCA635) All right are reserved with CU-IDOL
INTRODUCTION 5 A Program does nothing unless its instructions are executed by a CPU. A program in execution is called a process. In order to accomplish its task, process needs the computer resources. There may exist more than one process in the system which may require the same resource at the same time. Therefore, the operating system has to manage all the processes and the resources in a convenient and efficient way. Some resources may need to be executed by one process at one time to maintain the consistency otherwise the system can become inconsistent and deadlock may occur. www.cuidol.in Unit-7 (MCA635) All right are reserved with CU-IDOL
INTRODUCTION 6 Operating system is responsible for the following activities in connection with Process Management. 1. Scheduling processes and threads on the CPUs. 2. Creating and deleting both user and system processes. 3. Suspending and resuming processes. 4. Providing mechanisms for process synchronization. 5. Providing mechanisms for process communication. www.cuidol.in Unit-7 (MCA635) All right are reserved with CU-IDOL
ATTRIBUTES OF A PROCESS 7 The Attributes of the process are used by the Operating System to create the process control block (PCB) for each of them. This is also called context of the process. Attributes which are stored in the PCB are described below: 1. Process ID 2. Program Counter 3. Process State 4. Priority 5. General Purpose Registers 6. List of Open Files 7. List of Open Devices www.cuidol.in Unit-7 (MCA635) All right are reserved with CU-IDOL
STATE DIAGRAM 8 www.cuidol.in Unit-7 (MCA635) All right are reserved with CU-IDOL
PROCESS STATE 9 • The process, from its creation to completion, passes through various states. The minimum number of states is five. The names of the states are not standardized although the process may be in one of the following states during execution: 1. New 2. Ready 3. Running 4. Block orWait 5. Completion or Termination 6. Suspend Ready 7. Suspend wait www.cuidol.in Unit-7 (MCA635) All right are reserved with CU-IDOL
OPERATIONS ON THE 10 PROCESS Creation: Once the process is created, it will be ready and come into the ready queue (main memory) and will be ready for the execution. Scheduling: Out of the many processes present in the ready queue, the Operating system chooses one process and start executing it. Selecting the process which is to be executed next, is known as scheduling. Execution: Once the process is scheduled for the execution, the processor starts executing it. Process may come to the blocked or wait state during the execution then in that case the processor starts executing the other processes. Deletion/killing: Once the purpose of the process gets over then the OS will kill the process. The Context of the process (PCB) will be deleted and the process gets terminated by the Operating system. www.cuidol.in Unit-7 (MCA635) All right are reserved with CU-IDOL
PROCESS 11 SCHEDULERS Long-term Scheduler: Long-term scheduler is also known as job scheduler. It chooses the processes from the pool (secondary memory) and keeps them in the ready queue maintained in the primary memory. • Long-term scheduler mainly controls the degree of Multiprogramming. The purpose of long term scheduler is to choose a perfect mix of IO bound and CPU bound processes among the jobs present in the pool. • If the job scheduler chooses more IO bound processes then all of the jobs may reside in the blocked state all the time and the CPU will remain idle most of the time. This will reduce the degree of Multiprogramming. Therefore, the Job of long term scheduler is very critical and may affect the .system for a very long time www.cuidol.in Unit-7 (MCA635) All right are reserved with CU-IDOL
PROCESS 12 SCHEDULERS Short-term scheduler: Short-term scheduler is also known as CPU scheduler. It selects one of the Jobs from the ready queue and dispatch to the CPU for the execution. • A scheduling algorithm is used to select which job is going to be dispatched for the execution. The Job of the short term scheduler can be very critical in the sense that if it selects job whose CPU burst time is very high then all the jobs after that, will have to wait in the ready queue for a very long time. • This problem is called starvation which may arise if the short term scheduler makes some mistakes while selecting the job. www.cuidol.in Unit-7 (MCA635) All right are reserved with CU-IDOL
VARIOUS TIMES RELATED TO PROCESS 13 Arrival Time Burst Time Completion Time Turnaround Time Waiting Time Response Time www.cuidol.in Unit-7 (MCA635) All right are reserved with CU-IDOL
PROCESS MIGRATION 14 • Migration of a process from one node to another node is known as process migration. There are 2 techniques for migration. 1. Pre preemptive: Also called “process migration” The migration is done in between the process of execution. 2. Non-pre preemptive: Also called “code migration” The migration is done before the process begins execution. www.cuidol.in Unit-7 (MCA635) All right are reserved with CU-IDOL
PROCESS MIGRATION 15 www.cuidol.in Unit-7 (MCA635) All right are reserved with CU-IDOL
PROCESS MIGRATION 16 • Process migration is the relocation of a process from its source node to another destination node. • A process can either be migrated before it starts execution on its source node which is called as non-preemptive process or during the course of its execution that is known as preemptive process migration. • Preemptive process migration is more costly compared to non-preemptive because the process environment must accompany the process to its new node. www.cuidol.in Unit-7 (MCA635) All right are reserved with CU-IDOL
PROCESS MIGRATION 17 • Steps involved in process migration: (i) Process is selected for migration. (ii) Select destination node for the process to be migrated. (iii) Transfer of selected process to the destination node. • Migration policy is responsible for first two steps while third step is handles by migration mechanism. • Migration of a process is complex that involves handling various activities to meet the requirements for a good process migration. www.cuidol.in Unit-7 (MCA635) All right are reserved with CU-IDOL
PROCESS 18 MIGRATION • A preemptive process migration facility allows the transfer of an executing process from one node to another. On the other hand, in system supporting only non-preemptive migration facility, a process can only be transferred prior to beginning its execution. • Preemptive process migration is costlier than non-preemptive process migration since the process state, which must accompany the process to its new node, becomes much more complex after execution begins. www.cuidol.in Unit-7 (MCA635) All right are reserved with CU-IDOL
THREADS 19 • Life Cycle of a Thread (Thread States): A thread can be in one of the five states. According to sun, there is only 4 states in thread life cycle in java new, runnable, non-runnable and terminated. There is no running state. But for better understanding the threads, we are explaining it in the 5 states. The life cycle of the thread in java is controlled by JVM. The java thread states are as follows: 1. New 2. Runnable 3. Running 4. Non-Runnable (Blocked) 5. Terminated www.cuidol.in Unit-7 (MCA635) All right are reserved with CU-IDOL
THREADS STATES 20 www.cuidol.in Unit-7 (MCA635) All right are reserved with CU-IDOL
THREADS STATES 21 1. New: The thread is in new state if you create an instance of Thread class but before the invocation of start() method. 2. Runnable: The thread is in runnable state after invocation of start() method, but the thread scheduler has not selected it to be the running thread. 3. Running: The thread is in running state if the thread scheduler has selected it. 4. Non-runnable (Blocked): This is the state when the thread is still alive, but is currently not eligible to run. 5. Terminated: A thread is in terminated or dead state when its run() method exits. www.cuidol.in Unit-7 (MCA635) All right are reserved with CU-IDOL
VIRTUALIZATION 22 • Server Virtualization is the partitioning of a physical server into number of small virtual servers, each running its own operating system. These operating systems are known as guest operating systems. • These are running on another operating system known as host operating system. Each guest running in this manner is unaware of any other guests running on the same host. Different virtualization techniques are employed to achieve this transparency. www.cuidol.in Unit-7 (MCA635) All right are reserved with CU-IDOL
TYPES OF SERVER 23 VIRTUALIZATION 1. Hypervisor: A Hypervisor or VMM(virtual machine monitor) is a layer that exits between the operating system and hardware. It provides the necessary services and features for the smooth running of multiple operating systems. 2. It identifies traps, responds to privileged CPU instructions and handles queuing, dispatching and returning the hardware requests. A host operating system also runs on top of the hypervisor to administer and manage the virtual machines. www.cuidol.in Unit-7 (MCA635) All right are reserved with CU-IDOL
TYPES OF SERVER 24 VIRTUALIZATION Advantages: • Easier • Enhanced Performance • No emulation overhead Limitations: • Requires modification to guest operating system www.cuidol.in Unit-7 (MCA635) All right are reserved with CU-IDOL
FULL 25 VIRTUALIZATION Advantages: • No modification to Guest operating system required. Limitations: • Complex • Slower due to emulation • Installation of new device driver difficult. www.cuidol.in Unit-7 (MCA635) All right are reserved with CU-IDOL
KERNEL LEVEL 26 VIRTUALIZATION Advantages: • No special administrative software required. • Very less overhead Limitations: • Hardware Support Required www.cuidol.in Unit-7 (MCA635) All right are reserved with CU-IDOL
KERNEL LEVEL VIRTUALIZATION 27 Advantages: • Significantly light weight than complete machines(including a kernel) • Can host many more virtual servers • Enhanced Security and isolation Limitations: • Kernel or driver problem can take down all virtual servers. Unit-7 (MCA635) All right are reserved with CU-IDOL www.cuidol.in
CLIENTS AND 28 SERVERS • Client/Server communication involves two components, namely a client and a server. • They are usually multiple clients in communication with a single server. • The clients send requests to the server and the server responds to the client requests. www.cuidol.in Unit-7 (MCA635) All right are reserved with CU-IDOL
SOCKETS 29 • Sockets facilitate communication between two processes on the same machine or different machines. They are used in a client/server framework and consist of the IP address and port number. Many application protocols use sockets for data connection and data transfer between a client and a server. • Socket communication is quite low-level as sockets only transfer an unstructured byte stream across processes. The structure on the byte stream is imposed by the client and server applications. www.cuidol.in Unit-7 (MCA635) All right are reserved with CU-IDOL
SOCKETS 30 www.cuidol.in Unit-7 (MCA635) All right are reserved with CU-IDOL
REMOTE PROCEDURE CALLS 31 • These are interprocess communication techniques that are used for client-server based applications. A remote procedure call is also known as a subroutine call or a function call. • A client has a request that the RPC translates and sends to the server. This request may be a procedure or a function call to a remote server. When the server receives the request, it sends the required response back to the client. www.cuidol.in Unit-7 (MCA635) All right are reserved with CU-IDOL
REMOTE PROCEDURE CALLS 32 www.cuidol.in Unit-7 (MCA635) All right are reserved with CU-IDOL
PIPES 33 • These are interprocess communication methods that contain two end points. Data is entered from one end of the pipe by a process and consumed from the other end by the other process. • The two different types of pipes are ordinary pipes and named pipes. Ordinary pipes only allow one way communication. For two way communication, two pipes are required. Ordinary pipes have a parent child relationship between the processes as the pipes can only be accessed by processes that created or inherited them. • Named pipes are more powerful than ordinary pipes and allow two way communication. These pipes exist even after the processes using them have terminated. They need to be explicitly deleted when not required anymore. www.cuidol.in Unit-7 (MCA635) All right are reserved with CU-IDOL
PIPES 34 www.cuidol.in Unit-7 (MCA635) All right are reserved with CU-IDOL
CODE MIGRATION 35 • Code migration in distributed systems took place in the form of process migration in which an entire process was moved from one machine to another. • Moving a running process to a different machine is a costly and intricate task, and there had better be a good reason for doing so. • Support for code migration can also help improve performance by exploiting parallelism, but without the usual intricacies related to parallel programming. www.cuidol.in Unit-7 (MCA635) All right are reserved with CU-IDOL
MULTIPLE CHOICE QUESTIONS 1) The systems which allow only one process execution at a time, are called ____________. 36 (a) uniprogramming systems (b) uniprocessing systems (c) unitasking systems (d) none of the mentioned 2) In operating system, each process has its own ____________. (a) address space and global variables (b) open files (c) pending alarms, signals and signal handlers (d) all of the mentioned 3) In Unix, Which system call creates the new process? (a) fork (b) create (c) new (d) none of the mentioned 4) A process can be terminated due to ____________. (a) normal exit (b) fatal error (c) killed by another process (d) all of the mentioned Answers:1) (b) 2)(d) 3) (a) 4)(d) www.cuidol.in Unit-7 (MCA635) All right are reserved with CU-IDOL
MULTIPLE CHOICE QUESTIONS 37 5) What is the ready state of a process? (a) when process is scheduled to run after some execution (b) when process is unable to run until some task has been completed (c) when process is using the CPU (d) none of the mentioned 6) What is interprocess communication? (a) communication within the process (b) communication between two process (c) communication between two threads of same process (d) none of the mentioned 7) A set of processes is deadlock if ____________. (a) each process is blocked and will remain so forever (b) each process is terminated (c) all processes are trying to kill each other (d) none of the mentioned Answers: 5) (a) 6.(b) 7.(a) www.cuidol.in Unit-7 (MCA635) All right are reserved with CU-IDOL
MULTIPLE CHOICE QUESTIONS 38 8) A process stack does not contain ____________. (a) Function parameters (b) Local variables (c) Return addresses (d) PID of child process 9) Which system call returns the process identifier of a terminated child? (a) Wait (b) exit (c) fork (d) get 10) The address of the next instruction to be executed by the current process is provided by the ____________. (a) CPU registers (b) Program counter (c) Process stack (d) Pipe Answers: 8)(d) 9) (a) 10)(b) www.cuidol.in Unit-7 (MCA635) All right are reserved with CU-IDOL
SUMMARY 39 A Program does nothing unless its instructions are executed by a CPU. A program in execution is called a process. In order to accomplish its task, process needs the computer resources. There may exist more than one process in the system which may require the same resource at the same time. Therefore, the operating system has to manage all the processes and the resources in a convenient and efficient way. Some resources may need to be executed by one process at one time to maintain the consistency otherwise the system can become inconsistent and deadlock may occur. www.cuidol.in Unit-7 (MCA635) All right are reserved with CU-IDOL
SUMMARY 40 Migration of a process from one node to another node is known as process migration. There are 2 techniques for migration. 1. Pre preemptive: Also called \"process migration\" The migration is done in between the process of execution. 2. Non-pre preemptive: Also called “code migration “The migration is done before the process begins execution. A thread can be in one of the five states. According to sun, there are only 4 states in thread life cycle in java new, runnable, non-runnable and terminated. There is no running state. www.cuidol.in Unit-7 (MCA635) All right are reserved with CU-IDOL
FREQUENTLY ASKED QUESTIONS 41 Q1:What is Thread? Ans : A thread is a path of execution within a process. A process can contain multiple threads. For further details please refer to Slide no. 19 and SLM unit 7. Q2: What is difference between Process and Thread? Ans : For further details please refer to Slide no. 7 & 19 and SLM unit 7. Q3: What are the advantages of Process management? Ans : For further details please refer to Slide no. 6 and SLM unit 7. Q4: What is meant by Virtualization? Give example Ans : Server Virtualization is the partitioning of a physical server into number of small virtual servers, each running its own operating system. For further details please refer to Slide no. 22 and SLM unit 7. Q5: What is Code Migration? www.cuidol.in Unit-7 (MCA635) All right are reserved with CU-IDOL
FREQUENTLY ASKED QUESTIONS 42 Ans : code migration in distributed systems took place in the form of process migration in which an entire process was moved from one machine to another. For further details please refer to Slide no. 35 and SLM unit 7. Q6: Define Process management? Ans : For further details please refer to Slide no. 6 and SLM unit 7. Q7: Define process migration? Ans : Migration of a process from one node to another node is known as process migration. For further details please refer to Slide no. 14 and SLM unit 7. Q8: What are the Clients, Servers? Ans : The clients send requests to the server and the server responds to the client requests. For further details please refer to Slide no. 28 and SLM unit 7. www.cuidol.in Unit-7 (MCA635) All right are reserved with CU-IDOL
REFERENCES 43 M.R. Bhujade, “Parallel Computing”, 2nd edition, New Age International Publishers 2009. Andrew S. Tanenbaum and Maarten Van Steen, “Distributed Systems: Principles and Paradigms, 2nd edition, Pearson Education, Inc., 2007, ISBN: 0-13-239227-5. George Coulouris, Jean Dollimore, Tim Kindberg, “Distributed Systems: Concepts and Design” (4th Edition), Addison Wesley/Pearson Education. Pradeep K Sinha, “Distributed Operating Systems: Concepts and design”, IEEE computer society press www.cuidol.in Unit-7 (MCA635) All right are reserved with CU-IDOL
44 THANK YOU www.cuidol.in Unit-7 (MCA635) All right are reserved with CU-IDOL
Search
Read the Text Version
- 1 - 44
Pages: