SlideShare une entreprise Scribd logo
1  sur  19
Télécharger pour lire hors ligne
Part II
Process Management
   Chapter 3: Processes


                          1
Process Management

§   The Concept of a Process
§   Process Scheduling
§   Operations on Processes
§   Cooperating Processes
§   Interprocess Communication



                                 2
The Concept of a Process

§   What is a process?
§   Process states
§   Process control block
§   Threads




                                3
Process: Definition 1/2
§ When the OS runs a program (i.e., a binary
  executable), this program is loaded into memory
  and the control is transferred to this program’s
  first instruction. Then, the program starts to run.
§ A process is a program in execution.
§ A process is more than a program, because the
  former has a program counter, stack, data section
  and so on (i.e., the runtime stuffs).
§ Moreover, multiple processes may be associated
  with one program (e.g., run the same program, a
  web browser, twice).
                                                  4
Process: Definition 2/2
                  max
                          stack




                          heap
program counter
                          data      global data

                   0    text/code   program code

                                                   5
Process States
At any moment, a process can be in one of the five
states: new, running, waiting, ready and terminated.
vNew: The process is being created
vRunning: The process is being executed
vWaiting: The process is waiting for some event
 to occur (e.g., waiting for I/O completion)
vReady: The process is waiting to be assigned to a
 processor.
vTerminated: The process has finished execution.
                                                  6
Process State Diagram
converting to process
                                    reclaim resource
    new                             destroy process  terminated

         admitted         scheduler dispatch                   exit

                  ready                    running
                              interrupt
waiting for CPU
                                                   I/O or event wait
        I/O or event
        completion              waiting

                        waiting for I/O or event                 7
Process Control Block (PCB)
                      § Each process has a
pointer    process      number, the process ID.
            state
                      § Process info are stored
    process ID          in a table, the process
 program counter        control block (PCB).
                      § These PCBs are chained
    registers
                        into a number of lists.
   memory limits        For example, all
 list of open files
                        processes in the ready
                        status are in the ready
                        queue.
                                             8
Process Scheduling
§ Since the number of processes is always larger
  than the number of CPUs, the OS must
  maintain maximum CPU utilization.
§ To determine which process can do what,
  processes are chained into a number of
  scheduling queues.
§ For example, in addition to the ready queue,
  each event may have its own scheduling queue
  (i.e., waiting queue).

                                                   9
Various Scheduling Queues
       ready queue
head
tail

       tape 2
head
tail
       disk 0
head
tail

       term. 2
head
tail

                            10
Queuing Diagram for Scheduling

    ready queue                                CPU



   I/O            I/O queue          I/O request



                                  time slice expired


                  child execute      fork a child


                   interrupt         wait for an
                   occurs            interrupt         11
Schedulers
§ There are three types of schedulers
  ØLong-Term (Job) Scheduler: selects jobs and
    loads them into the system for execution (the
    new state). Executes less frequently.
  ØShort-Term (CPU) scheduler: selects from
    among the processes (in the ready queue),
    and allocates the CPU to one of them.
    Executes very frequently.
  ØMedium-Term Scheduler: does swapping to
    balance system load.
                                                12
Medium-Term Scheduler
 swap-in                              swap-out
              partially executed
            swapped-out processes




    ready queue                     CPU
                                                 end




                            I/O waiting
    I/O
                              queue

                                                 13
Context Switch
§ What is a process context? The context of a
  process includes the values of CPU registers,
  the process state, the program counter, and
  other memory/file management information.
§ What is a context switch? After the CPU
  scheduler selects a process (from the ready
  queue) and before allocates CPU to it, the CPU
  scheduler must
  Ø save the context of the currently running process,
  Ø put it into a queue,
  Ø load the context of the selected process, and
  Ø let it run.
                                                         14
Context Switch
    process 0      operating system      process 1

running
                                              idle
                save context into PCB0


                load context from PCB1
                                              running
   idle
                save context into PCB1


                load context from PCB0
                                              idle
running
                                                     15
Operations on Processes
q There are three commonly seen operations:
   vProcess Creation: Create a new process. The newly
    created is the child of the original. Use fork() or
    vfork() in Unix to create new processes.
   vProcess Termination: Terminate the execution of a
     process. Under Unix, use exit().
   vProcess Join: Wait for the completion of a child
     process. Under Unix use wait().
q fork(), vfork(), exit() and wait() are system
  calls.
q Use “ps –aux” to see all running processes
q Will discuss this later in this semester.
                                                      16
Cooperating Processes
§ A process is independent if it cannot affect or
  be affected by the other processes executing in
  the system.
§ A process is cooperating if it can affect or be
  affected by the other processes executing in
  the system.
§ Therefore, any process that shares resources
  with other processes is a cooperating process.


                                               17
Why Is Cooperating Processes Important?
§ Information sharing: Multiple processes can use
  the same set of information (e.g., files).
§ Computation Speedup: One may split a process
  into multiple processes to use multiple processors.
§ Modularity: A system can be divided into separate
  processes. Use the ps command to see how many
  processes are not yours!
§ Convenience: A user may have multiple tasks to
  work at the same time (e.g., editing, browsing,
  printing).
§ However, handling cooperating processes is
  difficult. You will hate me very soon, J 18
Interprocess Communications (IPC)
qCooperating processes must communicate to
 get the job done.
qThere are two types of communications:
  vProcesses that share the same memory:
    locks, semaphores, monitors, and others.
  vProcesses that are running in a distributed
    environment: message passing, sockets,
    remote procedure calls (RPC).
qWill cover both in later lectures.

                                                 19

Contenu connexe

Tendances

MG6088 SOFTWARE PROJECT MANAGEMENT
MG6088 SOFTWARE PROJECT MANAGEMENTMG6088 SOFTWARE PROJECT MANAGEMENT
MG6088 SOFTWARE PROJECT MANAGEMENTKathirvel Ayyaswamy
 
Process in operating system
Process in operating systemProcess in operating system
Process in operating systemChetan Mahawar
 
DeadLock in Operating-Systems
DeadLock in Operating-SystemsDeadLock in Operating-Systems
DeadLock in Operating-SystemsVenkata Sreeram
 
Mass Storage Structure
Mass Storage StructureMass Storage Structure
Mass Storage StructureVimalanathan D
 
Chapter 13 software testing strategies
Chapter 13 software testing strategiesChapter 13 software testing strategies
Chapter 13 software testing strategiesSHREEHARI WADAWADAGI
 
Software Risk Management
Software Risk ManagementSoftware Risk Management
Software Risk ManagementGunjan Patel
 
Waterfall model ppt final
Waterfall model ppt  finalWaterfall model ppt  final
Waterfall model ppt finalshiva krishna
 
Golang - Overview of Go (golang) Language
Golang - Overview of Go (golang) LanguageGolang - Overview of Go (golang) Language
Golang - Overview of Go (golang) LanguageAniruddha Chakrabarti
 
Chess board problem(divide and conquer)
Chess board problem(divide and conquer)Chess board problem(divide and conquer)
Chess board problem(divide and conquer)RASHIARORA8
 
Scheduling Definition, objectives and types
Scheduling Definition, objectives and types Scheduling Definition, objectives and types
Scheduling Definition, objectives and types Maitree Patel
 
Operating Systems Chapter 6 silberschatz
Operating Systems Chapter 6 silberschatzOperating Systems Chapter 6 silberschatz
Operating Systems Chapter 6 silberschatzGiulianoRanauro
 
Operating System-Threads-Galvin
Operating System-Threads-GalvinOperating System-Threads-Galvin
Operating System-Threads-GalvinSonali Chauhan
 
Operating system 24 mutex locks and semaphores
Operating system 24 mutex locks and semaphoresOperating system 24 mutex locks and semaphores
Operating system 24 mutex locks and semaphoresVaibhav Khanna
 
Multilevel queue scheduling
Multilevel queue schedulingMultilevel queue scheduling
Multilevel queue schedulingAditiPawaskar5
 

Tendances (20)

MG6088 SOFTWARE PROJECT MANAGEMENT
MG6088 SOFTWARE PROJECT MANAGEMENTMG6088 SOFTWARE PROJECT MANAGEMENT
MG6088 SOFTWARE PROJECT MANAGEMENT
 
Process in operating system
Process in operating systemProcess in operating system
Process in operating system
 
DeadLock in Operating-Systems
DeadLock in Operating-SystemsDeadLock in Operating-Systems
DeadLock in Operating-Systems
 
Software Crisis
Software CrisisSoftware Crisis
Software Crisis
 
Mass Storage Structure
Mass Storage StructureMass Storage Structure
Mass Storage Structure
 
Spiral Model
Spiral ModelSpiral Model
Spiral Model
 
Chapter 13 software testing strategies
Chapter 13 software testing strategiesChapter 13 software testing strategies
Chapter 13 software testing strategies
 
Chapter 3: Processes
Chapter 3: ProcessesChapter 3: Processes
Chapter 3: Processes
 
Software Risk Management
Software Risk ManagementSoftware Risk Management
Software Risk Management
 
Waterfall model ppt final
Waterfall model ppt  finalWaterfall model ppt  final
Waterfall model ppt final
 
Golang - Overview of Go (golang) Language
Golang - Overview of Go (golang) LanguageGolang - Overview of Go (golang) Language
Golang - Overview of Go (golang) Language
 
Chess board problem(divide and conquer)
Chess board problem(divide and conquer)Chess board problem(divide and conquer)
Chess board problem(divide and conquer)
 
Scheduling Definition, objectives and types
Scheduling Definition, objectives and types Scheduling Definition, objectives and types
Scheduling Definition, objectives and types
 
Cs8493 unit 3
Cs8493 unit 3Cs8493 unit 3
Cs8493 unit 3
 
Operating Systems Chapter 6 silberschatz
Operating Systems Chapter 6 silberschatzOperating Systems Chapter 6 silberschatz
Operating Systems Chapter 6 silberschatz
 
Operating System-Threads-Galvin
Operating System-Threads-GalvinOperating System-Threads-Galvin
Operating System-Threads-Galvin
 
Operating system 24 mutex locks and semaphores
Operating system 24 mutex locks and semaphoresOperating system 24 mutex locks and semaphores
Operating system 24 mutex locks and semaphores
 
Deadlock ppt
Deadlock ppt Deadlock ppt
Deadlock ppt
 
Rad model
Rad modelRad model
Rad model
 
Multilevel queue scheduling
Multilevel queue schedulingMultilevel queue scheduling
Multilevel queue scheduling
 

Similaire à Process

Operating Systems Unit Two - Fourth Semester - Engineering
Operating Systems Unit Two - Fourth Semester - EngineeringOperating Systems Unit Two - Fourth Semester - Engineering
Operating Systems Unit Two - Fourth Semester - EngineeringYogesh Santhan
 
UNIT-2-Process-Management.pdf
UNIT-2-Process-Management.pdfUNIT-2-Process-Management.pdf
UNIT-2-Process-Management.pdfaakritii765
 
Operating System-Concepts of Process
Operating System-Concepts of ProcessOperating System-Concepts of Process
Operating System-Concepts of ProcessShipra Swati
 
Process management
Process managementProcess management
Process managementBirju Tank
 
23565104 process-management(2)
23565104 process-management(2)23565104 process-management(2)
23565104 process-management(2)Anuj Malhotra
 
LM9 - OPERATIONS, SCHEDULING, Inter process xommuncation
LM9 - OPERATIONS, SCHEDULING, Inter process xommuncationLM9 - OPERATIONS, SCHEDULING, Inter process xommuncation
LM9 - OPERATIONS, SCHEDULING, Inter process xommuncationMani Deepak Choudhry
 
Ch2_Processes_and_process_management_1.ppt
Ch2_Processes_and_process_management_1.pptCh2_Processes_and_process_management_1.ppt
Ch2_Processes_and_process_management_1.pptMohammad Almuiet
 
OS - Process Concepts
OS - Process ConceptsOS - Process Concepts
OS - Process ConceptsMukesh Chinta
 
OS_Unit II - Process Management_CATI.pptx
OS_Unit II - Process Management_CATI.pptxOS_Unit II - Process Management_CATI.pptx
OS_Unit II - Process Management_CATI.pptxGokhul2
 
Operating System 3
Operating System 3Operating System 3
Operating System 3tech2click
 
Chapter -2 operating system presentation
Chapter -2 operating system presentationChapter -2 operating system presentation
Chapter -2 operating system presentationchnrketan
 
Os unit 3 , process management
Os unit 3 , process managementOs unit 3 , process management
Os unit 3 , process managementArnav Chowdhury
 
Module 3-cpu-scheduling
Module 3-cpu-schedulingModule 3-cpu-scheduling
Module 3-cpu-schedulingHesham Elmasry
 

Similaire à Process (20)

Operating Systems Unit Two - Fourth Semester - Engineering
Operating Systems Unit Two - Fourth Semester - EngineeringOperating Systems Unit Two - Fourth Semester - Engineering
Operating Systems Unit Two - Fourth Semester - Engineering
 
UNIT-2-Process-Management.pdf
UNIT-2-Process-Management.pdfUNIT-2-Process-Management.pdf
UNIT-2-Process-Management.pdf
 
OS (1).pptx
OS (1).pptxOS (1).pptx
OS (1).pptx
 
Operating System-Concepts of Process
Operating System-Concepts of ProcessOperating System-Concepts of Process
Operating System-Concepts of Process
 
3 process management
3 process management3 process management
3 process management
 
Processes
ProcessesProcesses
Processes
 
Process management
Process managementProcess management
Process management
 
23565104 process-management(2)
23565104 process-management(2)23565104 process-management(2)
23565104 process-management(2)
 
LM9 - OPERATIONS, SCHEDULING, Inter process xommuncation
LM9 - OPERATIONS, SCHEDULING, Inter process xommuncationLM9 - OPERATIONS, SCHEDULING, Inter process xommuncation
LM9 - OPERATIONS, SCHEDULING, Inter process xommuncation
 
Ch2_Processes_and_process_management_1.ppt
Ch2_Processes_and_process_management_1.pptCh2_Processes_and_process_management_1.ppt
Ch2_Processes_and_process_management_1.ppt
 
OS - Process Concepts
OS - Process ConceptsOS - Process Concepts
OS - Process Concepts
 
UNIT - 3 PPT(Part- 1)_.pdf
UNIT - 3 PPT(Part- 1)_.pdfUNIT - 3 PPT(Part- 1)_.pdf
UNIT - 3 PPT(Part- 1)_.pdf
 
OS_Unit II - Process Management_CATI.pptx
OS_Unit II - Process Management_CATI.pptxOS_Unit II - Process Management_CATI.pptx
OS_Unit II - Process Management_CATI.pptx
 
Operating System 3
Operating System 3Operating System 3
Operating System 3
 
Chapter -2 operating system presentation
Chapter -2 operating system presentationChapter -2 operating system presentation
Chapter -2 operating system presentation
 
Chapter03
Chapter03Chapter03
Chapter03
 
Process
ProcessProcess
Process
 
Os unit 3 , process management
Os unit 3 , process managementOs unit 3 , process management
Os unit 3 , process management
 
OS-Process.pdf
OS-Process.pdfOS-Process.pdf
OS-Process.pdf
 
Module 3-cpu-scheduling
Module 3-cpu-schedulingModule 3-cpu-scheduling
Module 3-cpu-scheduling
 

Plus de Mohd Arif

Bootp and dhcp
Bootp and dhcpBootp and dhcp
Bootp and dhcpMohd Arif
 
Arp and rarp
Arp and rarpArp and rarp
Arp and rarpMohd Arif
 
User datagram protocol
User datagram protocolUser datagram protocol
User datagram protocolMohd Arif
 
Project identification
Project identificationProject identification
Project identificationMohd Arif
 
Project evalaution techniques
Project evalaution techniquesProject evalaution techniques
Project evalaution techniquesMohd Arif
 
Presentation
PresentationPresentation
PresentationMohd Arif
 
Pointers in c
Pointers in cPointers in c
Pointers in cMohd Arif
 
Peer to-peer
Peer to-peerPeer to-peer
Peer to-peerMohd Arif
 
Overview of current communications systems
Overview of current communications systemsOverview of current communications systems
Overview of current communications systemsMohd Arif
 
Overall 23 11_2007_hdp
Overall 23 11_2007_hdpOverall 23 11_2007_hdp
Overall 23 11_2007_hdpMohd Arif
 
Objectives of budgeting
Objectives of budgetingObjectives of budgeting
Objectives of budgetingMohd Arif
 
Network management
Network managementNetwork management
Network managementMohd Arif
 
Networing basics
Networing basicsNetworing basics
Networing basicsMohd Arif
 
Iris ngx next generation ip based switching platform
Iris ngx next generation ip based switching platformIris ngx next generation ip based switching platform
Iris ngx next generation ip based switching platformMohd Arif
 
Ip sec and ssl
Ip sec and  sslIp sec and  ssl
Ip sec and sslMohd Arif
 
Ip security in i psec
Ip security in i psecIp security in i psec
Ip security in i psecMohd Arif
 
Intro to comp. hardware
Intro to comp. hardwareIntro to comp. hardware
Intro to comp. hardwareMohd Arif
 

Plus de Mohd Arif (20)

Bootp and dhcp
Bootp and dhcpBootp and dhcp
Bootp and dhcp
 
Arp and rarp
Arp and rarpArp and rarp
Arp and rarp
 
User datagram protocol
User datagram protocolUser datagram protocol
User datagram protocol
 
Project identification
Project identificationProject identification
Project identification
 
Project evalaution techniques
Project evalaution techniquesProject evalaution techniques
Project evalaution techniques
 
Presentation
PresentationPresentation
Presentation
 
Pointers in c
Pointers in cPointers in c
Pointers in c
 
Peer to-peer
Peer to-peerPeer to-peer
Peer to-peer
 
Overview of current communications systems
Overview of current communications systemsOverview of current communications systems
Overview of current communications systems
 
Overall 23 11_2007_hdp
Overall 23 11_2007_hdpOverall 23 11_2007_hdp
Overall 23 11_2007_hdp
 
Objectives of budgeting
Objectives of budgetingObjectives of budgeting
Objectives of budgeting
 
Network management
Network managementNetwork management
Network management
 
Networing basics
Networing basicsNetworing basics
Networing basics
 
Loaders
LoadersLoaders
Loaders
 
Lists
ListsLists
Lists
 
Iris ngx next generation ip based switching platform
Iris ngx next generation ip based switching platformIris ngx next generation ip based switching platform
Iris ngx next generation ip based switching platform
 
Ip sec and ssl
Ip sec and  sslIp sec and  ssl
Ip sec and ssl
 
Ip security in i psec
Ip security in i psecIp security in i psec
Ip security in i psec
 
Intro to comp. hardware
Intro to comp. hardwareIntro to comp. hardware
Intro to comp. hardware
 
Heap sort
Heap sortHeap sort
Heap sort
 

Dernier

Call Girls In Nangloi Rly Metro ꧂…….95996 … 13876 Enjoy ꧂Escort
Call Girls In Nangloi Rly Metro ꧂…….95996 … 13876 Enjoy ꧂EscortCall Girls In Nangloi Rly Metro ꧂…….95996 … 13876 Enjoy ꧂Escort
Call Girls In Nangloi Rly Metro ꧂…….95996 … 13876 Enjoy ꧂Escortdlhescort
 
Call Girls Electronic City Just Call 👗 7737669865 👗 Top Class Call Girl Servi...
Call Girls Electronic City Just Call 👗 7737669865 👗 Top Class Call Girl Servi...Call Girls Electronic City Just Call 👗 7737669865 👗 Top Class Call Girl Servi...
Call Girls Electronic City Just Call 👗 7737669865 👗 Top Class Call Girl Servi...amitlee9823
 
How to Get Started in Social Media for Art League City
How to Get Started in Social Media for Art League CityHow to Get Started in Social Media for Art League City
How to Get Started in Social Media for Art League CityEric T. Tung
 
SEO Case Study: How I Increased SEO Traffic & Ranking by 50-60% in 6 Months
SEO Case Study: How I Increased SEO Traffic & Ranking by 50-60%  in 6 MonthsSEO Case Study: How I Increased SEO Traffic & Ranking by 50-60%  in 6 Months
SEO Case Study: How I Increased SEO Traffic & Ranking by 50-60% in 6 MonthsIndeedSEO
 
Call Girls From Raj Nagar Extension Ghaziabad❤️8448577510 ⊹Best Escorts Servi...
Call Girls From Raj Nagar Extension Ghaziabad❤️8448577510 ⊹Best Escorts Servi...Call Girls From Raj Nagar Extension Ghaziabad❤️8448577510 ⊹Best Escorts Servi...
Call Girls From Raj Nagar Extension Ghaziabad❤️8448577510 ⊹Best Escorts Servi...lizamodels9
 
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableCall Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableSeo
 
Al Mizhar Dubai Escorts +971561403006 Escorts Service In Al Mizhar
Al Mizhar Dubai Escorts +971561403006 Escorts Service In Al MizharAl Mizhar Dubai Escorts +971561403006 Escorts Service In Al Mizhar
Al Mizhar Dubai Escorts +971561403006 Escorts Service In Al Mizharallensay1
 
Call Girls Service In Old Town Dubai ((0551707352)) Old Town Dubai Call Girl ...
Call Girls Service In Old Town Dubai ((0551707352)) Old Town Dubai Call Girl ...Call Girls Service In Old Town Dubai ((0551707352)) Old Town Dubai Call Girl ...
Call Girls Service In Old Town Dubai ((0551707352)) Old Town Dubai Call Girl ...allensay1
 
Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...
Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...
Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...amitlee9823
 
Cheap Rate Call Girls In Noida Sector 62 Metro 959961乂3876
Cheap Rate Call Girls In Noida Sector 62 Metro 959961乂3876Cheap Rate Call Girls In Noida Sector 62 Metro 959961乂3876
Cheap Rate Call Girls In Noida Sector 62 Metro 959961乂3876dlhescort
 
Call Girls In Noida 959961⊹3876 Independent Escort Service Noida
Call Girls In Noida 959961⊹3876 Independent Escort Service NoidaCall Girls In Noida 959961⊹3876 Independent Escort Service Noida
Call Girls In Noida 959961⊹3876 Independent Escort Service Noidadlhescort
 
Call Girls Zirakpur👧 Book Now📱7837612180 📞👉Call Girl Service In Zirakpur No A...
Call Girls Zirakpur👧 Book Now📱7837612180 📞👉Call Girl Service In Zirakpur No A...Call Girls Zirakpur👧 Book Now📱7837612180 📞👉Call Girl Service In Zirakpur No A...
Call Girls Zirakpur👧 Book Now📱7837612180 📞👉Call Girl Service In Zirakpur No A...Sheetaleventcompany
 
👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...
👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...
👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...rajveerescorts2022
 
Eluru Call Girls Service ☎ ️93326-06886 ❤️‍🔥 Enjoy 24/7 Escort Service
Eluru Call Girls Service ☎ ️93326-06886 ❤️‍🔥 Enjoy 24/7 Escort ServiceEluru Call Girls Service ☎ ️93326-06886 ❤️‍🔥 Enjoy 24/7 Escort Service
Eluru Call Girls Service ☎ ️93326-06886 ❤️‍🔥 Enjoy 24/7 Escort ServiceDamini Dixit
 
Phases of Negotiation .pptx
 Phases of Negotiation .pptx Phases of Negotiation .pptx
Phases of Negotiation .pptxnandhinijagan9867
 
Malegaon Call Girls Service ☎ ️82500–77686 ☎️ Enjoy 24/7 Escort Service
Malegaon Call Girls Service ☎ ️82500–77686 ☎️ Enjoy 24/7 Escort ServiceMalegaon Call Girls Service ☎ ️82500–77686 ☎️ Enjoy 24/7 Escort Service
Malegaon Call Girls Service ☎ ️82500–77686 ☎️ Enjoy 24/7 Escort ServiceDamini Dixit
 
Uneak White's Personal Brand Exploration Presentation
Uneak White's Personal Brand Exploration PresentationUneak White's Personal Brand Exploration Presentation
Uneak White's Personal Brand Exploration Presentationuneakwhite
 
Organizational Transformation Lead with Culture
Organizational Transformation Lead with CultureOrganizational Transformation Lead with Culture
Organizational Transformation Lead with CultureSeta Wicaksana
 
The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...
The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...
The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...Aggregage
 
Chandigarh Escorts Service 📞8868886958📞 Just📲 Call Nihal Chandigarh Call Girl...
Chandigarh Escorts Service 📞8868886958📞 Just📲 Call Nihal Chandigarh Call Girl...Chandigarh Escorts Service 📞8868886958📞 Just📲 Call Nihal Chandigarh Call Girl...
Chandigarh Escorts Service 📞8868886958📞 Just📲 Call Nihal Chandigarh Call Girl...Sheetaleventcompany
 

Dernier (20)

Call Girls In Nangloi Rly Metro ꧂…….95996 … 13876 Enjoy ꧂Escort
Call Girls In Nangloi Rly Metro ꧂…….95996 … 13876 Enjoy ꧂EscortCall Girls In Nangloi Rly Metro ꧂…….95996 … 13876 Enjoy ꧂Escort
Call Girls In Nangloi Rly Metro ꧂…….95996 … 13876 Enjoy ꧂Escort
 
Call Girls Electronic City Just Call 👗 7737669865 👗 Top Class Call Girl Servi...
Call Girls Electronic City Just Call 👗 7737669865 👗 Top Class Call Girl Servi...Call Girls Electronic City Just Call 👗 7737669865 👗 Top Class Call Girl Servi...
Call Girls Electronic City Just Call 👗 7737669865 👗 Top Class Call Girl Servi...
 
How to Get Started in Social Media for Art League City
How to Get Started in Social Media for Art League CityHow to Get Started in Social Media for Art League City
How to Get Started in Social Media for Art League City
 
SEO Case Study: How I Increased SEO Traffic & Ranking by 50-60% in 6 Months
SEO Case Study: How I Increased SEO Traffic & Ranking by 50-60%  in 6 MonthsSEO Case Study: How I Increased SEO Traffic & Ranking by 50-60%  in 6 Months
SEO Case Study: How I Increased SEO Traffic & Ranking by 50-60% in 6 Months
 
Call Girls From Raj Nagar Extension Ghaziabad❤️8448577510 ⊹Best Escorts Servi...
Call Girls From Raj Nagar Extension Ghaziabad❤️8448577510 ⊹Best Escorts Servi...Call Girls From Raj Nagar Extension Ghaziabad❤️8448577510 ⊹Best Escorts Servi...
Call Girls From Raj Nagar Extension Ghaziabad❤️8448577510 ⊹Best Escorts Servi...
 
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableCall Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
 
Al Mizhar Dubai Escorts +971561403006 Escorts Service In Al Mizhar
Al Mizhar Dubai Escorts +971561403006 Escorts Service In Al MizharAl Mizhar Dubai Escorts +971561403006 Escorts Service In Al Mizhar
Al Mizhar Dubai Escorts +971561403006 Escorts Service In Al Mizhar
 
Call Girls Service In Old Town Dubai ((0551707352)) Old Town Dubai Call Girl ...
Call Girls Service In Old Town Dubai ((0551707352)) Old Town Dubai Call Girl ...Call Girls Service In Old Town Dubai ((0551707352)) Old Town Dubai Call Girl ...
Call Girls Service In Old Town Dubai ((0551707352)) Old Town Dubai Call Girl ...
 
Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...
Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...
Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...
 
Cheap Rate Call Girls In Noida Sector 62 Metro 959961乂3876
Cheap Rate Call Girls In Noida Sector 62 Metro 959961乂3876Cheap Rate Call Girls In Noida Sector 62 Metro 959961乂3876
Cheap Rate Call Girls In Noida Sector 62 Metro 959961乂3876
 
Call Girls In Noida 959961⊹3876 Independent Escort Service Noida
Call Girls In Noida 959961⊹3876 Independent Escort Service NoidaCall Girls In Noida 959961⊹3876 Independent Escort Service Noida
Call Girls In Noida 959961⊹3876 Independent Escort Service Noida
 
Call Girls Zirakpur👧 Book Now📱7837612180 📞👉Call Girl Service In Zirakpur No A...
Call Girls Zirakpur👧 Book Now📱7837612180 📞👉Call Girl Service In Zirakpur No A...Call Girls Zirakpur👧 Book Now📱7837612180 📞👉Call Girl Service In Zirakpur No A...
Call Girls Zirakpur👧 Book Now📱7837612180 📞👉Call Girl Service In Zirakpur No A...
 
👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...
👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...
👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...
 
Eluru Call Girls Service ☎ ️93326-06886 ❤️‍🔥 Enjoy 24/7 Escort Service
Eluru Call Girls Service ☎ ️93326-06886 ❤️‍🔥 Enjoy 24/7 Escort ServiceEluru Call Girls Service ☎ ️93326-06886 ❤️‍🔥 Enjoy 24/7 Escort Service
Eluru Call Girls Service ☎ ️93326-06886 ❤️‍🔥 Enjoy 24/7 Escort Service
 
Phases of Negotiation .pptx
 Phases of Negotiation .pptx Phases of Negotiation .pptx
Phases of Negotiation .pptx
 
Malegaon Call Girls Service ☎ ️82500–77686 ☎️ Enjoy 24/7 Escort Service
Malegaon Call Girls Service ☎ ️82500–77686 ☎️ Enjoy 24/7 Escort ServiceMalegaon Call Girls Service ☎ ️82500–77686 ☎️ Enjoy 24/7 Escort Service
Malegaon Call Girls Service ☎ ️82500–77686 ☎️ Enjoy 24/7 Escort Service
 
Uneak White's Personal Brand Exploration Presentation
Uneak White's Personal Brand Exploration PresentationUneak White's Personal Brand Exploration Presentation
Uneak White's Personal Brand Exploration Presentation
 
Organizational Transformation Lead with Culture
Organizational Transformation Lead with CultureOrganizational Transformation Lead with Culture
Organizational Transformation Lead with Culture
 
The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...
The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...
The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...
 
Chandigarh Escorts Service 📞8868886958📞 Just📲 Call Nihal Chandigarh Call Girl...
Chandigarh Escorts Service 📞8868886958📞 Just📲 Call Nihal Chandigarh Call Girl...Chandigarh Escorts Service 📞8868886958📞 Just📲 Call Nihal Chandigarh Call Girl...
Chandigarh Escorts Service 📞8868886958📞 Just📲 Call Nihal Chandigarh Call Girl...
 

Process

  • 1. Part II Process Management Chapter 3: Processes 1
  • 2. Process Management § The Concept of a Process § Process Scheduling § Operations on Processes § Cooperating Processes § Interprocess Communication 2
  • 3. The Concept of a Process § What is a process? § Process states § Process control block § Threads 3
  • 4. Process: Definition 1/2 § When the OS runs a program (i.e., a binary executable), this program is loaded into memory and the control is transferred to this program’s first instruction. Then, the program starts to run. § A process is a program in execution. § A process is more than a program, because the former has a program counter, stack, data section and so on (i.e., the runtime stuffs). § Moreover, multiple processes may be associated with one program (e.g., run the same program, a web browser, twice). 4
  • 5. Process: Definition 2/2 max stack heap program counter data global data 0 text/code program code 5
  • 6. Process States At any moment, a process can be in one of the five states: new, running, waiting, ready and terminated. vNew: The process is being created vRunning: The process is being executed vWaiting: The process is waiting for some event to occur (e.g., waiting for I/O completion) vReady: The process is waiting to be assigned to a processor. vTerminated: The process has finished execution. 6
  • 7. Process State Diagram converting to process reclaim resource new destroy process terminated admitted scheduler dispatch exit ready running interrupt waiting for CPU I/O or event wait I/O or event completion waiting waiting for I/O or event 7
  • 8. Process Control Block (PCB) § Each process has a pointer process number, the process ID. state § Process info are stored process ID in a table, the process program counter control block (PCB). § These PCBs are chained registers into a number of lists. memory limits For example, all list of open files processes in the ready status are in the ready queue. 8
  • 9. Process Scheduling § Since the number of processes is always larger than the number of CPUs, the OS must maintain maximum CPU utilization. § To determine which process can do what, processes are chained into a number of scheduling queues. § For example, in addition to the ready queue, each event may have its own scheduling queue (i.e., waiting queue). 9
  • 10. Various Scheduling Queues ready queue head tail tape 2 head tail disk 0 head tail term. 2 head tail 10
  • 11. Queuing Diagram for Scheduling ready queue CPU I/O I/O queue I/O request time slice expired child execute fork a child interrupt wait for an occurs interrupt 11
  • 12. Schedulers § There are three types of schedulers ØLong-Term (Job) Scheduler: selects jobs and loads them into the system for execution (the new state). Executes less frequently. ØShort-Term (CPU) scheduler: selects from among the processes (in the ready queue), and allocates the CPU to one of them. Executes very frequently. ØMedium-Term Scheduler: does swapping to balance system load. 12
  • 13. Medium-Term Scheduler swap-in swap-out partially executed swapped-out processes ready queue CPU end I/O waiting I/O queue 13
  • 14. Context Switch § What is a process context? The context of a process includes the values of CPU registers, the process state, the program counter, and other memory/file management information. § What is a context switch? After the CPU scheduler selects a process (from the ready queue) and before allocates CPU to it, the CPU scheduler must Ø save the context of the currently running process, Ø put it into a queue, Ø load the context of the selected process, and Ø let it run. 14
  • 15. Context Switch process 0 operating system process 1 running idle save context into PCB0 load context from PCB1 running idle save context into PCB1 load context from PCB0 idle running 15
  • 16. Operations on Processes q There are three commonly seen operations: vProcess Creation: Create a new process. The newly created is the child of the original. Use fork() or vfork() in Unix to create new processes. vProcess Termination: Terminate the execution of a process. Under Unix, use exit(). vProcess Join: Wait for the completion of a child process. Under Unix use wait(). q fork(), vfork(), exit() and wait() are system calls. q Use “ps –aux” to see all running processes q Will discuss this later in this semester. 16
  • 17. Cooperating Processes § A process is independent if it cannot affect or be affected by the other processes executing in the system. § A process is cooperating if it can affect or be affected by the other processes executing in the system. § Therefore, any process that shares resources with other processes is a cooperating process. 17
  • 18. Why Is Cooperating Processes Important? § Information sharing: Multiple processes can use the same set of information (e.g., files). § Computation Speedup: One may split a process into multiple processes to use multiple processors. § Modularity: A system can be divided into separate processes. Use the ps command to see how many processes are not yours! § Convenience: A user may have multiple tasks to work at the same time (e.g., editing, browsing, printing). § However, handling cooperating processes is difficult. You will hate me very soon, J 18
  • 19. Interprocess Communications (IPC) qCooperating processes must communicate to get the job done. qThere are two types of communications: vProcesses that share the same memory: locks, semaphores, monitors, and others. vProcesses that are running in a distributed environment: message passing, sockets, remote procedure calls (RPC). qWill cover both in later lectures. 19