Processes and Threads Chapter 2 2.1 Processes 2.2 Threads 2.3 Interprocess communication 2.4 Classical IPC problems 2.5 Scheduling.

Slides:



Advertisements
Similar presentations
1 Processes and Threads Creation and Termination States Usage Implementations.
Advertisements

1 Processes and Threads Chapter Processes 2.2 Threads 2.3 Interprocess communication 2.4 Classical IPC problems 2.5 Scheduling.
Pertemuan 13 Threads Matakuliah: H0483 / Network Programming Tahun: 2005 Versi: 1.0.
Operating Systems COMP 4850/CISG 5550 Processes Introduction to Threads Dr. James Money.
1 Created by Another Process Reason: modeling concurrent sub-tasks Fetch large amount data from network and process them Two sub-tasks: fetching  processing.
The Process Model.
Thursday, June 08, 2006 The number of UNIX installations has grown to 10, with more expected. The UNIX Programmer's Manual, 2nd Edition, June, 1972.
Page 1 Processes and Threads Chapter 2. Page 2 Processes The Process Model Multiprogramming of four programs Conceptual model of 4 independent, sequential.
Page 1 Processes and Threads Chapter Processes 2.2 Threads 2.3 Interprocess communication 2.4 Classical IPC problems 2.5 Scheduling.
1 Introduction Chapter What is an operating system 1.2 History of operating systems 1.3 The operating system zoo 1.4 Computer hardware review 1.5.
1 CS 333 Introduction to Operating Systems Class 2 – OS-Related Hardware & Software The Process Concept Jonathan Walpole Computer Science Portland State.
1 What is a Process ? The activity of program execution. Also called a task or job Has associated with it: Code Data Resources A State An executing set.
CSCE 351: Operating System Kernels
1 I/O Devices Controller: physically controls the devices Devices are diverse and complicated Present simpler interface to OS E.g, convert a linear sector.
CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University1 Process Management: Processes and Threads CS 342 – Operating Systems Ibrahim.
Ceng Operating Systems Chapter 2.1 : Processes Process concept Process scheduling Interprocess communication Deadlocks Threads.
CS-502 Fall 2006Processes in Unix, Linux, & Windows 1 Processes in Unix, Linux, and Windows CS502 Operating Systems.
Chapter 2 Processes and Threads Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved
CSSE Operating Systems
1 Introduction Chapter What is an operating system 1.2 History of operating systems 1.3 The operating system zoo 1.4 Computer hardware review 1.5.
OPERATING SYSTEM LESSON 4 PROCESS.
Chapter 1 Introduction 1.1 What is an operating system
Phones OFF Please Processes Parminder Singh Kang Home:
OPERATING SYSTEMS DESIGN AND IMPLEMENTATION Third Edition ANDREW S. TANENBAUM ALBERT S. WOODHULL Yan hao (Wilson) Wu University of the Western.
Process Description and Control Chapter 3. Major Requirements of an OS Interleave the execution of several processes to maximize processor utilization.
Copyright ©: Nahrstedt, Angrave, Abdelzaher1 Processes Tarek Abdelzaher Vikram Adve.
Processes and Threads.
Process Management. Processes Process Concept Process Scheduling Operations on Processes Interprocess Communication Examples of IPC Systems Communication.
Chapter 1 Introduction 1.1 What is an operating system
ITEC 502 컴퓨터 시스템 및 실습 Chapter 1: Introduction. ITEC 502 컴퓨터 시스템 및 실습 Chapter 1: Introduction Mi-Jung Choi DPNM Lab. Dept. of CSE,
1 Introduction Chapter What is an operating system 1.2 History of operating systems 1.3 The operating system zoo 1.4 Computer hardware review 1.5.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
1 Chapter 2.1 : Processes Process concept Process concept Process scheduling Process scheduling Interprocess communication Interprocess communication Threads.
ITEC 502 컴퓨터 시스템 및 실습 Chapter 2-1: Process Mi-Jung Choi DPNM Lab. Dept. of CSE, POSTECH.
Operating Systems Processes 1.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 3: Processes.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 3: Process-Concept.
Process Models, Creation and Termination Reference –text: Tanenbaum ch. 2.1.
Operating Systems Process Creation
2.1 Processes  process = abstraction of a running program.
Process Description and Control Chapter 3. Source Modified slides from Missouri U. of Science and Tech.
Cs431-cotter1 Processes and Threads Tanenbaum 2.1, 2.2 Crowley Chapters 3, 5 Stallings Chapter 3, 4 Silberschaz & Galvin 3, 4.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 3: Processes.
Processes and Threads MICROSOFT.  Process  Process Model  Process Creation  Process Termination  Process States  Implementation of Processes  Thread.
CSC414 “Introduction to UNIX/ Linux” Lecture 3
2.1 Processes  process = abstraction of a running program  multiprogramming = CPU switches from running program to running program  pseudoparallelism.
1 Module 3: Processes Reading: Chapter Next Module: –Inter-process Communication –Process Scheduling –Reading: Chapter 4.5, 6.1 – 6.3.
Topic 3 (Textbook - Chapter 3) Processes
Protection of System Resources
Chapter 2 Processes and Threads Today 2.1 Processes 2.2 Threads
Process Management Presented By Aditya Gupta Assistant Professor
Unix Process Management
Processes A process is a running program.
Example questions… Can a shell kill itself? Can a shell within a shell kill the parent shell? What happens to background processes when you exit from.
Chapter 3: Processes.
Lecture 5: Process Creation
Process Models, Creation and Termination
More examples How many processes does this piece of code create?
2.1 Processes process = abstraction of a running program
Module 2.1 COP4600 – Operating Systems Richard Newman
Chapter 3: Processes.
Chapter 2 Processes and Threads 2.1 Processes 2.2 Threads
Process Description and Control
Lecture 6: Multiprogramming and Context Switching
Chapter 3: Processes.
Processes in Unix and Windows
Chapter 2 Processes and Threads 2.1 Processes 2.2 Threads
CS510 Operating System Foundations
Process Management -Compiled for CSIT
Process Management -Compiled for CSIT
Presentation transcript:

Processes and Threads Chapter Processes 2.2 Threads 2.3 Interprocess communication 2.4 Classical IPC problems 2.5 Scheduling

What is a process? There is a subtle difference between the concepts of program and process –A process is a program in execution See p. 73 for a beautiful everyday analogy –It illustrates the notions of program, process, interrupt and pseudoparallelism.

Processes The Process Model Multiprogramming of four programs Conceptual model of 4 independent, sequential processes Only one program active at any instant

What causes process creation? System initialization –Foreground and background processes Execution of a process creation system –Through system calls – fork () in UNIX  User request to create a new process –The result of a double click in Windows Initiation of a batch job –On mainframes only

A stripped down shell with fork() while (TRUE) { /* repeat forever */ type_prompt( );/* display prompt */ read_command (command, parameters)/* input from terminal */ pid = fork(); /* fork off child process */ if (pid != 0) { /* Parent code */ waitpid( -1, &status, 0);/* wait for child to exit */ } else { /* Child code */ execve (command, parameters, 0);/* execute command */ }

What causes process termination? Normal exit (voluntary) –return 0; Error exit (voluntary) –Illegal instructions, division by zero, illegal memory access Fatal error (involuntary) –Incorrect program parameters Killed by another process (involuntary)

Process Hierarchies Parent creates a child process, child process may create its own process Forms a hierarchy –UNIX calls this a "process group" Windows has no concept of process hierarchy –All processes are created equal

Process tree A process group with root A –A created two child processes, B and C –B created three child processes, D, E, and F

Process States

Process Table There is a table entry for each process

Processes & Interrupts Low memory contains an interrupt vector for each I/O device. –It contains the address of the interrupt service procedure. When I/O completes, the CPU is interrupted –The PC, PSW & register contents of the process that is running at that moment are pushed onto the stack by the interrupt controller and the CPU executes the instruction at the address in the interrupt vector.