SlideShare a Scribd company logo
1 of 12
 A process group is collection of one or more process,
usually associated with same job.
 Each process group has a unique process group ID.
Process group ID’s are similar to process ID’s :
they are positive integers
And can be stored in pid_t data type.
 the function getpgrp returns the process group ID of the calling
Process.
#include< unistd. h>
Pid_t getpgrp(void)
Returns:process group ID of calling
process.
In older BSD-derived systems the getpgrp() uses argument as
shown.
#include< unistd. h>
Pid_t getpgid(pid_t pid)
Returns:process group ID if OK.
-1 on error
 If pid=0, the process group ID of calling process is
returned, thus
getpgid(0);
Is equivalent to
getpgrp();
• Each process group can have a process group leader.
• The leader is identified by its process group ID being
equal to its process ID.
• Process group lifetime: The period of time that begins
when the group is created and ends when the last
remaining process leaves the group.
• A process joins an existing group or creates a new process
group by calling setpgid().
#include< unistd. h>
Int setpgid(pid_t pid , pid_t pgid);
Return: 0 if ok,-1 on error
This function sets the process ID to pgid in the process whose
Process ID equals pid.
• if the 2 arguments are equal, the process specified by pid
becomes a process group leader.
•If pid=0,the process ID of the caller is used.
•If pgid=0,the process ID specified by pid is used as the process
Group ID.
sessions
A session is a collection of one or more process groups.
process group
proc1 proc2 Proc 3 Proc 4
Proc 5
Login shell
Process group
Process group
session
 In the above figure we have 3 process groups in a single
session.
 The processes in a process group are usually placed
there by a shell pipe line.
 For example: for the above fig
proc 1| proc 2 &
proc3|proc4|proc5
 a process establishes a new session by calling the setsid
function.
#include< unistd. h>
Pid_t setsid(void)
Returns: process group ID if OK,
, -1 on error
 If the calling process is not a process group leader, this
function creates a new session, and 3 things can
happen:
 1: the process becomes the session leader of this new
session. That is the only process in this new session.
 2: the process becomes the process group leader of a
new process group. The new process group ID is the
new process ID of the calling process.
 The process has no controlling terminal. If the process
had a controlling terminal before calling setsid, that
association is broken.
#include< unistd. h>
Pid_t getsid(pid_t pid);
Returns: session leader's process group
ID if OK, -1 on error
If pid=0, getsid returns the process group ID of the calling
process's session leader.
 Sessions and process groups have a few other
characteristics.
 A session can have a single controlling terminal. This is
usually the terminal device(in the case of terminal
login) or pseudo terminal device(in the case of a
network login) on which we login.
 The session leader that establishes the connection to
the controlling terminal is called controlling process.
 The process groups within a session can be divided
into a single foreground process group and one or
more background process groups.
Controlling terminal
 Whenever we type the terminal’s interrupt key(often
DELETE or CONTROL-C), this causes the interrupt
signal be sent to all processes in the foreground
process group.
 Whenever we type terminal’s quit key(often
CONTROL-BLCKSLASH), this causes the quit signal
to be sent to all processes in foreground process group.
 If the modem(or network) disconnect is detected, the
hang-up signal is sent to the controlling process(I,e
session leader).
Background
process group
Login shell Proc 1 proc2 proc3 proc4
proc5Background process
Group session leader=
Controlling process
Foreground process group
Controlling
terminal
Terminal input and terminal
generated signals.
Modem disconnect
(hang-up-signal)
Thank you…….

More Related Content

Similar to process group.

System Calls.pptxnsjsnssbhsbbebdbdbshshsbshsbbs
System Calls.pptxnsjsnssbhsbbebdbdbshshsbshsbbsSystem Calls.pptxnsjsnssbhsbbebdbdbshshsbshsbbs
System Calls.pptxnsjsnssbhsbbebdbdbshshsbshsbbs
ashukiller7
 
Lab report 201001067_201001104
Lab report 201001067_201001104Lab report 201001067_201001104
Lab report 201001067_201001104
swena_gupta
 
Lab report 201001067_201001104
Lab report 201001067_201001104Lab report 201001067_201001104
Lab report 201001067_201001104
swena_gupta
 
Lab report 201001067_201001104
Lab report 201001067_201001104Lab report 201001067_201001104
Lab report 201001067_201001104
swena_gupta
 

Similar to process group. (20)

System Calls - Introduction
System Calls - IntroductionSystem Calls - Introduction
System Calls - Introduction
 
Threads Advance in System Administration with Linux
Threads Advance in System Administration with LinuxThreads Advance in System Administration with Linux
Threads Advance in System Administration with Linux
 
System Calls.pptxnsjsnssbhsbbebdbdbshshsbshsbbs
System Calls.pptxnsjsnssbhsbbebdbdbshshsbshsbbsSystem Calls.pptxnsjsnssbhsbbebdbdbshshsbshsbbs
System Calls.pptxnsjsnssbhsbbebdbdbshshsbshsbbs
 
Operating System Practice : Meeting 5- process and manajemen proces-a-slide
Operating System Practice : Meeting 5- process and manajemen proces-a-slideOperating System Practice : Meeting 5- process and manajemen proces-a-slide
Operating System Practice : Meeting 5- process and manajemen proces-a-slide
 
Process management
Process managementProcess management
Process management
 
Os lab final
Os lab finalOs lab final
Os lab final
 
Process managment
Process  managmentProcess  managment
Process managment
 
Process management in linux
Process management in linuxProcess management in linux
Process management in linux
 
Lab report 201001067_201001104
Lab report 201001067_201001104Lab report 201001067_201001104
Lab report 201001067_201001104
 
Lab report 201001067_201001104
Lab report 201001067_201001104Lab report 201001067_201001104
Lab report 201001067_201001104
 
Lab report 201001067_201001104
Lab report 201001067_201001104Lab report 201001067_201001104
Lab report 201001067_201001104
 
System Administration: Linux Process
System Administration: Linux ProcessSystem Administration: Linux Process
System Administration: Linux Process
 
Gevent be or not to be
Gevent be or not to beGevent be or not to be
Gevent be or not to be
 
«Gevent — быть или не быть?» Александр Мокров, Positive Technologies
«Gevent — быть или не быть?» Александр Мокров, Positive Technologies«Gevent — быть или не быть?» Александр Мокров, Positive Technologies
«Gevent — быть или не быть?» Александр Мокров, Positive Technologies
 
Process management
Process managementProcess management
Process management
 
OS (1).pptx
OS (1).pptxOS (1).pptx
OS (1).pptx
 
Chapter 5 - THREADING & REGULAR exp - MAULIK BORSANIYA
Chapter 5 - THREADING & REGULAR exp - MAULIK BORSANIYAChapter 5 - THREADING & REGULAR exp - MAULIK BORSANIYA
Chapter 5 - THREADING & REGULAR exp - MAULIK BORSANIYA
 
Sysdig
SysdigSysdig
Sysdig
 
Operating System Practice : Meeting 6- process and manajemen proces-b-slide
Operating System Practice : Meeting 6- process and manajemen proces-b-slideOperating System Practice : Meeting 6- process and manajemen proces-b-slide
Operating System Practice : Meeting 6- process and manajemen proces-b-slide
 
1032 cs208 g operation system ip camera case share.v0.2
1032 cs208 g operation system ip camera case share.v0.21032 cs208 g operation system ip camera case share.v0.2
1032 cs208 g operation system ip camera case share.v0.2
 

Recently uploaded

Russian Escorts Agency In Goa 💚 9316020077 💚 Russian Call Girl Goa
Russian Escorts Agency In Goa  💚 9316020077 💚 Russian Call Girl GoaRussian Escorts Agency In Goa  💚 9316020077 💚 Russian Call Girl Goa
Russian Escorts Agency In Goa 💚 9316020077 💚 Russian Call Girl Goa
sexy call girls service in goa
 
Beautiful 😋 Call girls in Lahore 03210033448
Beautiful 😋 Call girls in Lahore 03210033448Beautiful 😋 Call girls in Lahore 03210033448
Beautiful 😋 Call girls in Lahore 03210033448
ont65320
 
Goa Call Girls 9316020077 Call Girls In Goa By Russian Call Girl in goa
Goa Call Girls 9316020077 Call Girls  In Goa By Russian Call Girl in goaGoa Call Girls 9316020077 Call Girls  In Goa By Russian Call Girl in goa
Goa Call Girls 9316020077 Call Girls In Goa By Russian Call Girl in goa
russian goa call girl and escorts service
 
Call Girls In Goa 9316020077 Goa Call Girl By Indian Call Girls Goa
Call Girls In Goa  9316020077 Goa  Call Girl By Indian Call Girls GoaCall Girls In Goa  9316020077 Goa  Call Girl By Indian Call Girls Goa
Call Girls In Goa 9316020077 Goa Call Girl By Indian Call Girls Goa
sexy call girls service in goa
 

Recently uploaded (20)

📞 Contact Number 8617697112 VIP Ganderbal Call Girls
📞 Contact Number 8617697112 VIP Ganderbal Call Girls📞 Contact Number 8617697112 VIP Ganderbal Call Girls
📞 Contact Number 8617697112 VIP Ganderbal Call Girls
 
Book Sex Workers Available Kolkata Call Girls Service Airport Kolkata ✔ 62971...
Book Sex Workers Available Kolkata Call Girls Service Airport Kolkata ✔ 62971...Book Sex Workers Available Kolkata Call Girls Service Airport Kolkata ✔ 62971...
Book Sex Workers Available Kolkata Call Girls Service Airport Kolkata ✔ 62971...
 
↑Top Model (Kolkata) Call Girls Sonagachi ⟟ 8250192130 ⟟ High Class Call Girl...
↑Top Model (Kolkata) Call Girls Sonagachi ⟟ 8250192130 ⟟ High Class Call Girl...↑Top Model (Kolkata) Call Girls Sonagachi ⟟ 8250192130 ⟟ High Class Call Girl...
↑Top Model (Kolkata) Call Girls Sonagachi ⟟ 8250192130 ⟟ High Class Call Girl...
 
Russian Escorts Agency In Goa 💚 9316020077 💚 Russian Call Girl Goa
Russian Escorts Agency In Goa  💚 9316020077 💚 Russian Call Girl GoaRussian Escorts Agency In Goa  💚 9316020077 💚 Russian Call Girl Goa
Russian Escorts Agency In Goa 💚 9316020077 💚 Russian Call Girl Goa
 
Beautiful 😋 Call girls in Lahore 03210033448
Beautiful 😋 Call girls in Lahore 03210033448Beautiful 😋 Call girls in Lahore 03210033448
Beautiful 😋 Call girls in Lahore 03210033448
 
Dakshineswar Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Se...
Dakshineswar Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Se...Dakshineswar Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Se...
Dakshineswar Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Se...
 
Hotel And Home Service Available Kolkata Call Girls Howrah ✔ 6297143586 ✔Call...
Hotel And Home Service Available Kolkata Call Girls Howrah ✔ 6297143586 ✔Call...Hotel And Home Service Available Kolkata Call Girls Howrah ✔ 6297143586 ✔Call...
Hotel And Home Service Available Kolkata Call Girls Howrah ✔ 6297143586 ✔Call...
 
Top Rated Pune Call Girls Dhayari ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
Top Rated  Pune Call Girls Dhayari ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...Top Rated  Pune Call Girls Dhayari ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
Top Rated Pune Call Girls Dhayari ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
 
Independent Sonagachi Escorts ✔ 9332606886✔ Full Night With Room Online Booki...
Independent Sonagachi Escorts ✔ 9332606886✔ Full Night With Room Online Booki...Independent Sonagachi Escorts ✔ 9332606886✔ Full Night With Room Online Booki...
Independent Sonagachi Escorts ✔ 9332606886✔ Full Night With Room Online Booki...
 
Goa Call Girls 9316020077 Call Girls In Goa By Russian Call Girl in goa
Goa Call Girls 9316020077 Call Girls  In Goa By Russian Call Girl in goaGoa Call Girls 9316020077 Call Girls  In Goa By Russian Call Girl in goa
Goa Call Girls 9316020077 Call Girls In Goa By Russian Call Girl in goa
 
Independent Garulia Escorts ✔ 9332606886✔ Full Night With Room Online Booking...
Independent Garulia Escorts ✔ 9332606886✔ Full Night With Room Online Booking...Independent Garulia Escorts ✔ 9332606886✔ Full Night With Room Online Booking...
Independent Garulia Escorts ✔ 9332606886✔ Full Night With Room Online Booking...
 
Model Call Girls In Pazhavanthangal WhatsApp Booking 7427069034 call girl ser...
Model Call Girls In Pazhavanthangal WhatsApp Booking 7427069034 call girl ser...Model Call Girls In Pazhavanthangal WhatsApp Booking 7427069034 call girl ser...
Model Call Girls In Pazhavanthangal WhatsApp Booking 7427069034 call girl ser...
 
Bhimtal ❤CALL GIRL 8617697112 ❤CALL GIRLS IN Bhimtal ESCORT SERVICE❤CALL GIRL
Bhimtal ❤CALL GIRL 8617697112 ❤CALL GIRLS IN Bhimtal ESCORT SERVICE❤CALL GIRLBhimtal ❤CALL GIRL 8617697112 ❤CALL GIRLS IN Bhimtal ESCORT SERVICE❤CALL GIRL
Bhimtal ❤CALL GIRL 8617697112 ❤CALL GIRLS IN Bhimtal ESCORT SERVICE❤CALL GIRL
 
Independent Hatiara Escorts ✔ 9332606886✔ Full Night With Room Online Booking...
Independent Hatiara Escorts ✔ 9332606886✔ Full Night With Room Online Booking...Independent Hatiara Escorts ✔ 9332606886✔ Full Night With Room Online Booking...
Independent Hatiara Escorts ✔ 9332606886✔ Full Night With Room Online Booking...
 
𓀤Call On 6297143586 𓀤 Ultadanga Call Girls In All Kolkata 24/7 Provide Call W...
𓀤Call On 6297143586 𓀤 Ultadanga Call Girls In All Kolkata 24/7 Provide Call W...𓀤Call On 6297143586 𓀤 Ultadanga Call Girls In All Kolkata 24/7 Provide Call W...
𓀤Call On 6297143586 𓀤 Ultadanga Call Girls In All Kolkata 24/7 Provide Call W...
 
❤Personal Whatsapp Number Keylong Call Girls 8617697112 💦✅.
❤Personal Whatsapp Number Keylong Call Girls 8617697112 💦✅.❤Personal Whatsapp Number Keylong Call Girls 8617697112 💦✅.
❤Personal Whatsapp Number Keylong Call Girls 8617697112 💦✅.
 
5* Hotels Call Girls In Goa {{07028418221}} Call Girls In North Goa Escort Se...
5* Hotels Call Girls In Goa {{07028418221}} Call Girls In North Goa Escort Se...5* Hotels Call Girls In Goa {{07028418221}} Call Girls In North Goa Escort Se...
5* Hotels Call Girls In Goa {{07028418221}} Call Girls In North Goa Escort Se...
 
Verified Trusted Call Girls Tambaram Chennai ✔✔7427069034 Independent Chenna...
Verified Trusted Call Girls Tambaram Chennai ✔✔7427069034  Independent Chenna...Verified Trusted Call Girls Tambaram Chennai ✔✔7427069034  Independent Chenna...
Verified Trusted Call Girls Tambaram Chennai ✔✔7427069034 Independent Chenna...
 
↑Top Model (Kolkata) Call Girls Behala ⟟ 8250192130 ⟟ High Class Call Girl In...
↑Top Model (Kolkata) Call Girls Behala ⟟ 8250192130 ⟟ High Class Call Girl In...↑Top Model (Kolkata) Call Girls Behala ⟟ 8250192130 ⟟ High Class Call Girl In...
↑Top Model (Kolkata) Call Girls Behala ⟟ 8250192130 ⟟ High Class Call Girl In...
 
Call Girls In Goa 9316020077 Goa Call Girl By Indian Call Girls Goa
Call Girls In Goa  9316020077 Goa  Call Girl By Indian Call Girls GoaCall Girls In Goa  9316020077 Goa  Call Girl By Indian Call Girls Goa
Call Girls In Goa 9316020077 Goa Call Girl By Indian Call Girls Goa
 

process group.

  • 1.  A process group is collection of one or more process, usually associated with same job.  Each process group has a unique process group ID. Process group ID’s are similar to process ID’s : they are positive integers And can be stored in pid_t data type.
  • 2.  the function getpgrp returns the process group ID of the calling Process. #include< unistd. h> Pid_t getpgrp(void) Returns:process group ID of calling process. In older BSD-derived systems the getpgrp() uses argument as shown. #include< unistd. h> Pid_t getpgid(pid_t pid) Returns:process group ID if OK. -1 on error
  • 3.  If pid=0, the process group ID of calling process is returned, thus getpgid(0); Is equivalent to getpgrp(); • Each process group can have a process group leader. • The leader is identified by its process group ID being equal to its process ID. • Process group lifetime: The period of time that begins when the group is created and ends when the last remaining process leaves the group.
  • 4. • A process joins an existing group or creates a new process group by calling setpgid(). #include< unistd. h> Int setpgid(pid_t pid , pid_t pgid); Return: 0 if ok,-1 on error This function sets the process ID to pgid in the process whose Process ID equals pid. • if the 2 arguments are equal, the process specified by pid becomes a process group leader. •If pid=0,the process ID of the caller is used. •If pgid=0,the process ID specified by pid is used as the process Group ID.
  • 5. sessions A session is a collection of one or more process groups. process group proc1 proc2 Proc 3 Proc 4 Proc 5 Login shell Process group Process group session
  • 6.  In the above figure we have 3 process groups in a single session.  The processes in a process group are usually placed there by a shell pipe line.  For example: for the above fig proc 1| proc 2 & proc3|proc4|proc5  a process establishes a new session by calling the setsid function. #include< unistd. h> Pid_t setsid(void) Returns: process group ID if OK, , -1 on error
  • 7.  If the calling process is not a process group leader, this function creates a new session, and 3 things can happen:  1: the process becomes the session leader of this new session. That is the only process in this new session.  2: the process becomes the process group leader of a new process group. The new process group ID is the new process ID of the calling process.  The process has no controlling terminal. If the process had a controlling terminal before calling setsid, that association is broken.
  • 8. #include< unistd. h> Pid_t getsid(pid_t pid); Returns: session leader's process group ID if OK, -1 on error If pid=0, getsid returns the process group ID of the calling process's session leader.
  • 9.  Sessions and process groups have a few other characteristics.  A session can have a single controlling terminal. This is usually the terminal device(in the case of terminal login) or pseudo terminal device(in the case of a network login) on which we login.  The session leader that establishes the connection to the controlling terminal is called controlling process.  The process groups within a session can be divided into a single foreground process group and one or more background process groups. Controlling terminal
  • 10.  Whenever we type the terminal’s interrupt key(often DELETE or CONTROL-C), this causes the interrupt signal be sent to all processes in the foreground process group.  Whenever we type terminal’s quit key(often CONTROL-BLCKSLASH), this causes the quit signal to be sent to all processes in foreground process group.  If the modem(or network) disconnect is detected, the hang-up signal is sent to the controlling process(I,e session leader).
  • 11. Background process group Login shell Proc 1 proc2 proc3 proc4 proc5Background process Group session leader= Controlling process Foreground process group Controlling terminal Terminal input and terminal generated signals. Modem disconnect (hang-up-signal)