SlideShare ist ein Scribd-Unternehmen logo
1 von 27
T S PRADEEP KUMAR
   Process Introduction
   Process States
   Process Control Block (PCB or TCB)
   Process creation and I/O Requests
   Schedulers
   A program in execution
   Process in memory has
    ◦ Text section (includes program code)
    ◦ Data section (global variables)
    ◦ Stack (contains the return address, local address,
      function parameters)
    ◦ Heap (dynamic runtime memory during the
      execution of process and this may vary)
stack


heap


data


text
   Program is a passive entity
   Program stores sequence of instructions written
    in a file stored in the secondary memory
   Process is active entity which has program
    counter that tells the next instruction to be
    executed and also has a set of associated
    resources.
   Program becomes a process when the file is
    loaded in the primary memory
    ◦ Example: double click the executable file of running
      a.out is example of program -> process
   New – a process is generated
   Ready – multiple processes are ready to run
    under a CPU.
   Running – currently executing on the CPU
   Waiting – Waiting for an Event or an IO, Once
    the event is available, process moves to the
    ready state.
   Terminated – Process is killed or terminated
   Identifier: A unique identifier associated with this
    process, to distinguish it from all other
    processes.
   State: If the process is currently executing, it is in
    the running state.
   Priority: Priority level relative to other processes.
   Program counter: The address of the next
    instruction in the program to be executed.
   Memory pointers: Includes pointers to the
    program code and data associated with this
    process, plus any memory blocks shared with
    other processes.
   Context data: These are data that are present
    in registers in the processor while the process
    is executing.
   I/O status information: Includes outstanding
    I/O requests, I/O devices (e.g., disk drives)
    assigned to this process, a list of files in use
    by the process, and so on.
   Accounting information: May include the
    amount of processor time and clock time
    used, time limits, account numbers, and so
    on.
pid_t pid                    Process identifier
Long state                   State of a process
Unsigned int time_slice      Scheduling information
Struct task_struct *parent   This process’s parent
Struct list_head child;      This process’s children
Struct files_struct *files   List of open files
Struct mm_struct *mm         Addresss space of this process
int main()
{
pid_t pid;
pid =fork();
if (pid < 0) { I* error occurred *I
fprintf(stderr, "Fork Failed");
return 1;
}
else if (pid == 0) { I* child process *I
execlp("lbinlls","ls",NULL);
}
else { I* parent process *I
}
wait (NULL) ;
printf("Child Complete");
return 0;}
   A process migrates among various scheduling
    queues throughout its lifetime
   Long Term Scheduler or Job Scheduler
    ◦ in a batch system, more processes are submitted
      than can be executed immediately.
    ◦ execute less frequently
   Short Term Scheduler or CPU Scheduler
    ◦ selects from among the processes that are ready
      to execute and allocates the CPU to one of them.
    ◦ Runs most frequently (ex: runs every 100ms)
   Processes are either I/O Bound or CPU Bound
   Long Term schedulers should have the
    correct mix of I/O Process and CPU Bound
    processes
   Short Term Scheduler schedules the
    Processes that are ready to run under the CPU
   So Unix and Microsoft does not have Long
    Term Schedulers as it more time to get
    executed
   When an interrupt occurs, the state of the
    process to be saved which called as context
    switching
   It depends highly on the hardware support
   Hardware architecture should have more
    number of registers as compared to more
    number of context switches.
   Reasons for IPC
    ◦ Information Sharing
      Sharing file between processes
    ◦ Computational Speedup
      Processes are break down in to sub-process
    ◦ Modularity
    ◦ Convenience
      Individual user can work on many tasks at the same
       time
   Independent Processes
    ◦ No interference with other processes in the system
   Cooperative processes
    ◦ Shared Memory
    ◦ Message Passing
   Message Passing
    ◦ Suitable for smaller amount of data
    ◦ Easier to implement
    ◦ Usually implemented using System calls, so kernel
      is bothered every-time during message
      communication
   Shared Memory
    ◦ Faster to implement
    ◦ system calls are required only to establish shared-
      memory regions.
    ◦ Once shared memory is established, all accesses are
      treated as routine memory accesses, and no
      assistance from the kernel is required.
   Use of Producer – Consumer relations
   Producer will produce and consumer will
    consume the items produced by the producer
   P-C problem achieved through
    ◦ Unbounded buffer
      No limit on the size of queue
       The consumer may have to wait for new items
        but the producer can always produce new items.
    ◦ Bounded buffer
      Implement like a circular Queue
      Producer will wait if the queue is full
      Consume will waif if the queue is empty
#define BUFFER_SIZE 10
typedef struct {
…
}item;
item buffer[BUFFER_SIZE];
int in = 0;
int out = 0;
/*
Buffer is empty when in==out
Buffer is full when ((in+1)%BUFFER_SIZE)==out
*/
while (true) {
/* produce an item in nextProduced *I
while ( ((in + 1) % BUFFER_SIZE) == out)
I* do nothing *I
buffer[in] = nextProduced;
in = (in + 1) % BUFFER_SIZE;
}
item nextConsumed;
while (true) {
while (in == out)
; II do nothing
nextConsumed = buffer[out];
out = (out + 1) % BUFFER_SIZE;
I* consume the item in nextConsumed *I
}

Weitere ähnliche Inhalte

Was ist angesagt?

Threads (operating System)
Threads (operating System)Threads (operating System)
Threads (operating System)Prakhar Maurya
 
Cpu scheduling in operating System.
Cpu scheduling in operating System.Cpu scheduling in operating System.
Cpu scheduling in operating System.Ravi Kumar Patel
 
Critical section problem in operating system.
Critical section problem in operating system.Critical section problem in operating system.
Critical section problem in operating system.MOHIT DADU
 
CPU Scheduling in OS Presentation
CPU Scheduling in OS  PresentationCPU Scheduling in OS  Presentation
CPU Scheduling in OS Presentationusmankiyani1
 
Process creation and termination In Operating System
Process creation and termination In Operating SystemProcess creation and termination In Operating System
Process creation and termination In Operating SystemFarhan Aslam
 
Kernel. Operating System
Kernel. Operating SystemKernel. Operating System
Kernel. Operating Systempratikkadam78
 
Operating systems system structures
Operating systems   system structuresOperating systems   system structures
Operating systems system structuresMukesh Chinta
 
Operating System-Process Scheduling
Operating System-Process SchedulingOperating System-Process Scheduling
Operating System-Process SchedulingShipra Swati
 
Shortest job first Scheduling (SJF)
Shortest job first Scheduling (SJF)Shortest job first Scheduling (SJF)
Shortest job first Scheduling (SJF)ritu98
 
introduction to Python (for beginners)
introduction to Python (for beginners)introduction to Python (for beginners)
introduction to Python (for beginners)guobichrng
 

Was ist angesagt? (20)

Threads (operating System)
Threads (operating System)Threads (operating System)
Threads (operating System)
 
Cpu scheduling in operating System.
Cpu scheduling in operating System.Cpu scheduling in operating System.
Cpu scheduling in operating System.
 
Critical section problem in operating system.
Critical section problem in operating system.Critical section problem in operating system.
Critical section problem in operating system.
 
CPU Scheduling in OS Presentation
CPU Scheduling in OS  PresentationCPU Scheduling in OS  Presentation
CPU Scheduling in OS Presentation
 
Python algorithm
Python algorithmPython algorithm
Python algorithm
 
Process creation and termination In Operating System
Process creation and termination In Operating SystemProcess creation and termination In Operating System
Process creation and termination In Operating System
 
Kernel. Operating System
Kernel. Operating SystemKernel. Operating System
Kernel. Operating System
 
Operating systems system structures
Operating systems   system structuresOperating systems   system structures
Operating systems system structures
 
Operating System-Process Scheduling
Operating System-Process SchedulingOperating System-Process Scheduling
Operating System-Process Scheduling
 
operating system lecture notes
operating system lecture notesoperating system lecture notes
operating system lecture notes
 
scheduling
schedulingscheduling
scheduling
 
Evolution of os
Evolution of osEvolution of os
Evolution of os
 
File handling-c
File handling-cFile handling-c
File handling-c
 
Shortest job first Scheduling (SJF)
Shortest job first Scheduling (SJF)Shortest job first Scheduling (SJF)
Shortest job first Scheduling (SJF)
 
GE3151 problem solving and python programming - Syllabus
GE3151 problem solving and python programming - SyllabusGE3151 problem solving and python programming - Syllabus
GE3151 problem solving and python programming - Syllabus
 
Disk scheduling
Disk schedulingDisk scheduling
Disk scheduling
 
introduction to Python (for beginners)
introduction to Python (for beginners)introduction to Python (for beginners)
introduction to Python (for beginners)
 
Mainframe systems
Mainframe systemsMainframe systems
Mainframe systems
 
Chapter 3: Processes
Chapter 3: ProcessesChapter 3: Processes
Chapter 3: Processes
 
5 Process Scheduling
5 Process Scheduling5 Process Scheduling
5 Process Scheduling
 

Andere mochten auch (7)

Os presentation process
Os presentation processOs presentation process
Os presentation process
 
Chapter 3 - Processes
Chapter 3 - ProcessesChapter 3 - Processes
Chapter 3 - Processes
 
Process of operating system
Process of operating systemProcess of operating system
Process of operating system
 
Processes and threads
Processes and threadsProcesses and threads
Processes and threads
 
Processes Control Block (Operating System)
Processes Control Block (Operating System)Processes Control Block (Operating System)
Processes Control Block (Operating System)
 
Process management
Process managementProcess management
Process management
 
Introduction to Computers
Introduction to ComputersIntroduction to Computers
Introduction to Computers
 

Ähnlich wie Lecture 5 process concept

Lecture_Slide_4.pptx
Lecture_Slide_4.pptxLecture_Slide_4.pptx
Lecture_Slide_4.pptxDiptoRoy21
 
UNIT-2-Process-Management.pdf
UNIT-2-Process-Management.pdfUNIT-2-Process-Management.pdf
UNIT-2-Process-Management.pdfaakritii765
 
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
 
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
 
Advanced Operating Systems......Process Management
Advanced Operating Systems......Process ManagementAdvanced Operating Systems......Process Management
Advanced Operating Systems......Process ManagementVeejeya Kumbhar
 
Processes in Operating System
Processes in Operating SystemProcesses in Operating System
Processes in Operating SystemArafat Hossan
 
Chapter -2 operating system presentation
Chapter -2 operating system presentationChapter -2 operating system presentation
Chapter -2 operating system presentationchnrketan
 
Chapter 1 Introduction to Operating System Concepts
Chapter 1 Introduction to Operating System ConceptsChapter 1 Introduction to Operating System Concepts
Chapter 1 Introduction to Operating System ConceptsMeenalJabde
 

Ähnlich wie Lecture 5 process concept (20)

OS-Process.pdf
OS-Process.pdfOS-Process.pdf
OS-Process.pdf
 
Lecture_Slide_4.pptx
Lecture_Slide_4.pptxLecture_Slide_4.pptx
Lecture_Slide_4.pptx
 
UNIT-2-Process-Management.pdf
UNIT-2-Process-Management.pdfUNIT-2-Process-Management.pdf
UNIT-2-Process-Management.pdf
 
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
 
Cs8493 unit 2
Cs8493 unit 2Cs8493 unit 2
Cs8493 unit 2
 
LM9 - OPERATIONS, SCHEDULING, Inter process xommuncation
LM9 - OPERATIONS, SCHEDULING, Inter process xommuncationLM9 - OPERATIONS, SCHEDULING, Inter process xommuncation
LM9 - OPERATIONS, SCHEDULING, Inter process xommuncation
 
Process Management
Process ManagementProcess Management
Process Management
 
CS6401 OPERATING SYSTEMS Unit 2
CS6401 OPERATING SYSTEMS Unit 2CS6401 OPERATING SYSTEMS Unit 2
CS6401 OPERATING SYSTEMS Unit 2
 
Ch03- PROCESSES.ppt
Ch03- PROCESSES.pptCh03- PROCESSES.ppt
Ch03- PROCESSES.ppt
 
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
 
CH03.pdf
CH03.pdfCH03.pdf
CH03.pdf
 
Ch3 processes
Ch3   processesCh3   processes
Ch3 processes
 
UNIT - 3 PPT(Part- 1)_.pdf
UNIT - 3 PPT(Part- 1)_.pdfUNIT - 3 PPT(Part- 1)_.pdf
UNIT - 3 PPT(Part- 1)_.pdf
 
Advanced Operating Systems......Process Management
Advanced Operating Systems......Process ManagementAdvanced Operating Systems......Process Management
Advanced Operating Systems......Process Management
 
Processes in Operating System
Processes in Operating SystemProcesses in Operating System
Processes in Operating System
 
Chapter -2 operating system presentation
Chapter -2 operating system presentationChapter -2 operating system presentation
Chapter -2 operating system presentation
 
Chapter 1 Introduction to Operating System Concepts
Chapter 1 Introduction to Operating System ConceptsChapter 1 Introduction to Operating System Concepts
Chapter 1 Introduction to Operating System Concepts
 
Process
ProcessProcess
Process
 
Processes
ProcessesProcesses
Processes
 
Chapter 3.pdf
Chapter 3.pdfChapter 3.pdf
Chapter 3.pdf
 

Mehr von Pradeep Kumar TS

Digital Portfolio and Footprint
Digital Portfolio and FootprintDigital Portfolio and Footprint
Digital Portfolio and FootprintPradeep Kumar TS
 
Software Define Networking (SDN)
Software Define Networking (SDN)Software Define Networking (SDN)
Software Define Networking (SDN)Pradeep Kumar TS
 
What next - Career Enhancement of Graduates
What next - Career Enhancement of GraduatesWhat next - Career Enhancement of Graduates
What next - Career Enhancement of GraduatesPradeep Kumar TS
 
Higher Order Thinking - Question paper setting
Higher Order Thinking - Question paper settingHigher Order Thinking - Question paper setting
Higher Order Thinking - Question paper settingPradeep Kumar TS
 
IoT Communication Protocols
IoT Communication ProtocolsIoT Communication Protocols
IoT Communication ProtocolsPradeep Kumar TS
 
RPL - Routing Protocol for Low Power and Lossy Networks
RPL - Routing Protocol for Low Power and Lossy NetworksRPL - Routing Protocol for Low Power and Lossy Networks
RPL - Routing Protocol for Low Power and Lossy NetworksPradeep Kumar TS
 
Recompiling network simulator 2
Recompiling network simulator 2Recompiling network simulator 2
Recompiling network simulator 2Pradeep Kumar TS
 
OTcl and C++ linkages in NS2
OTcl and C++ linkages in NS2OTcl and C++ linkages in NS2
OTcl and C++ linkages in NS2Pradeep Kumar TS
 
Wired and Wireless Examples in ns2
Wired and Wireless Examples in ns2Wired and Wireless Examples in ns2
Wired and Wireless Examples in ns2Pradeep Kumar TS
 
Software Defined Networking - 1
Software Defined Networking - 1Software Defined Networking - 1
Software Defined Networking - 1Pradeep Kumar TS
 
Software Defined Networking - 2
Software Defined Networking - 2Software Defined Networking - 2
Software Defined Networking - 2Pradeep Kumar TS
 
Software Defined Networking - 3
Software Defined Networking - 3Software Defined Networking - 3
Software Defined Networking - 3Pradeep Kumar TS
 

Mehr von Pradeep Kumar TS (20)

Digital Portfolio and Footprint
Digital Portfolio and FootprintDigital Portfolio and Footprint
Digital Portfolio and Footprint
 
Open book Examination
Open book ExaminationOpen book Examination
Open book Examination
 
Software Define Networking (SDN)
Software Define Networking (SDN)Software Define Networking (SDN)
Software Define Networking (SDN)
 
What next - Career Enhancement of Graduates
What next - Career Enhancement of GraduatesWhat next - Career Enhancement of Graduates
What next - Career Enhancement of Graduates
 
Protothreads
ProtothreadsProtothreads
Protothreads
 
6LoWPAN
6LoWPAN 6LoWPAN
6LoWPAN
 
Software Defined Networks
Software Defined NetworksSoftware Defined Networks
Software Defined Networks
 
Higher Order Thinking - Question paper setting
Higher Order Thinking - Question paper settingHigher Order Thinking - Question paper setting
Higher Order Thinking - Question paper setting
 
IoT Communication Protocols
IoT Communication ProtocolsIoT Communication Protocols
IoT Communication Protocols
 
IoT Applications
IoT ApplicationsIoT Applications
IoT Applications
 
RPL - Routing Protocol for Low Power and Lossy Networks
RPL - Routing Protocol for Low Power and Lossy NetworksRPL - Routing Protocol for Low Power and Lossy Networks
RPL - Routing Protocol for Low Power and Lossy Networks
 
Mannasim for NS2
Mannasim for NS2Mannasim for NS2
Mannasim for NS2
 
Recompiling network simulator 2
Recompiling network simulator 2Recompiling network simulator 2
Recompiling network simulator 2
 
OTcl and C++ linkages in NS2
OTcl and C++ linkages in NS2OTcl and C++ linkages in NS2
OTcl and C++ linkages in NS2
 
Wired and Wireless Examples in ns2
Wired and Wireless Examples in ns2Wired and Wireless Examples in ns2
Wired and Wireless Examples in ns2
 
Installation of ns2
Installation of ns2Installation of ns2
Installation of ns2
 
Introduction to ns2
Introduction to ns2Introduction to ns2
Introduction to ns2
 
Software Defined Networking - 1
Software Defined Networking - 1Software Defined Networking - 1
Software Defined Networking - 1
 
Software Defined Networking - 2
Software Defined Networking - 2Software Defined Networking - 2
Software Defined Networking - 2
 
Software Defined Networking - 3
Software Defined Networking - 3Software Defined Networking - 3
Software Defined Networking - 3
 

Kürzlich hochgeladen

BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...RKavithamani
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 

Kürzlich hochgeladen (20)

BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 

Lecture 5 process concept

  • 1. T S PRADEEP KUMAR
  • 2. Process Introduction  Process States  Process Control Block (PCB or TCB)  Process creation and I/O Requests  Schedulers
  • 3. A program in execution  Process in memory has ◦ Text section (includes program code) ◦ Data section (global variables) ◦ Stack (contains the return address, local address, function parameters) ◦ Heap (dynamic runtime memory during the execution of process and this may vary)
  • 5.
  • 6. Program is a passive entity  Program stores sequence of instructions written in a file stored in the secondary memory  Process is active entity which has program counter that tells the next instruction to be executed and also has a set of associated resources.  Program becomes a process when the file is loaded in the primary memory ◦ Example: double click the executable file of running a.out is example of program -> process
  • 7.
  • 8. New – a process is generated  Ready – multiple processes are ready to run under a CPU.  Running – currently executing on the CPU  Waiting – Waiting for an Event or an IO, Once the event is available, process moves to the ready state.  Terminated – Process is killed or terminated
  • 9.
  • 10. Identifier: A unique identifier associated with this process, to distinguish it from all other processes.  State: If the process is currently executing, it is in the running state.  Priority: Priority level relative to other processes.  Program counter: The address of the next instruction in the program to be executed.  Memory pointers: Includes pointers to the program code and data associated with this process, plus any memory blocks shared with other processes.
  • 11. Context data: These are data that are present in registers in the processor while the process is executing.  I/O status information: Includes outstanding I/O requests, I/O devices (e.g., disk drives) assigned to this process, a list of files in use by the process, and so on.  Accounting information: May include the amount of processor time and clock time used, time limits, account numbers, and so on.
  • 12. pid_t pid Process identifier Long state State of a process Unsigned int time_slice Scheduling information Struct task_struct *parent This process’s parent Struct list_head child; This process’s children Struct files_struct *files List of open files Struct mm_struct *mm Addresss space of this process
  • 13.
  • 14.
  • 15.
  • 16. int main() { pid_t pid; pid =fork(); if (pid < 0) { I* error occurred *I fprintf(stderr, "Fork Failed"); return 1; } else if (pid == 0) { I* child process *I execlp("lbinlls","ls",NULL); } else { I* parent process *I } wait (NULL) ; printf("Child Complete"); return 0;}
  • 17. A process migrates among various scheduling queues throughout its lifetime  Long Term Scheduler or Job Scheduler ◦ in a batch system, more processes are submitted than can be executed immediately. ◦ execute less frequently  Short Term Scheduler or CPU Scheduler ◦ selects from among the processes that are ready to execute and allocates the CPU to one of them. ◦ Runs most frequently (ex: runs every 100ms)
  • 18. Processes are either I/O Bound or CPU Bound  Long Term schedulers should have the correct mix of I/O Process and CPU Bound processes  Short Term Scheduler schedules the Processes that are ready to run under the CPU  So Unix and Microsoft does not have Long Term Schedulers as it more time to get executed
  • 19. When an interrupt occurs, the state of the process to be saved which called as context switching  It depends highly on the hardware support  Hardware architecture should have more number of registers as compared to more number of context switches.
  • 20. Reasons for IPC ◦ Information Sharing  Sharing file between processes ◦ Computational Speedup  Processes are break down in to sub-process ◦ Modularity ◦ Convenience  Individual user can work on many tasks at the same time
  • 21. Independent Processes ◦ No interference with other processes in the system  Cooperative processes ◦ Shared Memory ◦ Message Passing
  • 22.
  • 23. Message Passing ◦ Suitable for smaller amount of data ◦ Easier to implement ◦ Usually implemented using System calls, so kernel is bothered every-time during message communication  Shared Memory ◦ Faster to implement ◦ system calls are required only to establish shared- memory regions. ◦ Once shared memory is established, all accesses are treated as routine memory accesses, and no assistance from the kernel is required.
  • 24. Use of Producer – Consumer relations  Producer will produce and consumer will consume the items produced by the producer  P-C problem achieved through ◦ Unbounded buffer  No limit on the size of queue  The consumer may have to wait for new items but the producer can always produce new items. ◦ Bounded buffer  Implement like a circular Queue  Producer will wait if the queue is full  Consume will waif if the queue is empty
  • 25. #define BUFFER_SIZE 10 typedef struct { … }item; item buffer[BUFFER_SIZE]; int in = 0; int out = 0; /* Buffer is empty when in==out Buffer is full when ((in+1)%BUFFER_SIZE)==out */
  • 26. while (true) { /* produce an item in nextProduced *I while ( ((in + 1) % BUFFER_SIZE) == out) I* do nothing *I buffer[in] = nextProduced; in = (in + 1) % BUFFER_SIZE; }
  • 27. item nextConsumed; while (true) { while (in == out) ; II do nothing nextConsumed = buffer[out]; out = (out + 1) % BUFFER_SIZE; I* consume the item in nextConsumed *I }