Exam 2, Question 1 Solution

Written by Sasank Vasa

Question 1. Processes and Process Control. (20 pts.)

Given the following pair of terms, explain the differences between the items to which these terms refer and explain why both are needed on the system:

A. Process ID (pid) and User ID (uid).

Process ID is a unique number that identifies a process in the system. It is the identifying signature of a process. Process ID is required for various process control and scheduling functions in the system. It cannot also be used by the applications to attain certain process specific funcationality.

Just like process ID identifies a process in the system, user ID identifies a user on the system. User Id is a unique non-negative integer. It is required to specify the ownership of various files and processes. These ownership and access privileges help keep the system secure and meet the privacy requirements.

B. Process Group ID (pgid) and Group ID (gid).

Processes can be placed in groups. Each such process group is denoted by a process group-id, which is of the same data type as a process id. It is useful when we want to handle a set of processes as a whole using an inter-process communication mechanisms like signals. Group ID is a unique number associated with a collection of users. Just like we group processes into a process group, we can group users into groups. Such user groups provide an easy way to handle controlling projects involving several people.

C. Process Group ID (pgid) and Session ID (sid).

Process Group ID uniquely identifies a group of processes grouped together for process management. This process group in turn belongs to a session. A session ID in turn uniquely identifies a session. A session is typically a collection of a single foreground and some background processes. A session is about a process's connection to a controlling terminal. When users log on, the processes and the process groups they implicitly or explicitly create belong to a session linked to the current terminal.