Topic 6 - Process & Job Control 1 Flashcards
All processes are handled and managed by:
the kernel through a scheduling services called the scheduler
In a single-processor computer, how many processes can be running at a time?
Only one process
What are the statuses a process can have at a time?
Either one of three:
1) Running
2) Ready to run
3) Blocked or sleeping
What does a Running Process mean?
Is executing for a short slice of time only
What does a Ready Process mean?
It could use the CPU immediately if it is allowed to do so.
The scheduler decides which of the ready processes to run next
What does a Blocked or Sleeping process mean?
Waiting for an event to occur, e.g., I/O or signal
Can you go from:
1) Running to Ready to Run?
2) Running to Blocked / Sleeping?
3) Ready to Run to Running?
4) Ready to Run to Blocked / Sleeping?
5) Blocked / Sleeping to Running?
6) Blocked / Sleeping to Ready to Run?
1) Yes
2) Yes
3) Yes
4) No
5) No
6) Yes
How does the system keep track of all the processes?
A process table
What is the first thing that happens when a process is created?
A process ID is created, or simply, PID.
Within Unix, every object is represented by?
Either a file or a process.
What maintains the process table?
Maintained by the kernel
What are the characteristics of a process table?
1) Indexed by the PID
2) Contains one entry for each process to store its attributes
List the 3 things a scheduler does:
1) Maintains a list of all the processes waiting to execute
2) Chooses one process at a time, and gives it change to run for short time called time slices (typically 10 milliseconds).
3) Saves data related to the interrupted processes so that they can be resumed later
What happens when a process needs the kernel to perform a service?
It sends a request (a system call) which will create new a process.
System calls provides an __________ between________ and _______.
an essential interface between a process and the operating system
What is the rule of process creation?
Every created process is a child process where it was generated from another parent process. (Except the first process during boot up)
There are 4 types of System Calls:
1) File-related calls
2) Information-related calls
3) Communication-related calls
4) Process-related calls
Define:
1) File-related calls
2) Information-related calls
3) Communication-related calls
4) Process-related calls
1) Opening- closing reading from or writing file
2) Information related calls - getting date / time
3) interprocess communication
4) Creating, executing, stopping a process
Some of the system calls that co-ordinate processes include the following. Describe them. Fork: Exec: Wait: Exit: Kill:
Fork - creates a copy (child) of current process (parent)
Exec - changes the program that a process is running
Wait - forces a process to pause
Exit - terminate a process
Kill - send a signal to another process
What are the two types of commands?
1) Internal Commands
2) External Commands
Define Internal Commands
Intercepted directly by the shell (no need to create a new process)
Define External commands
Required the shell to run a separate program (need to create a new process)
How do you run an external command?
Use the fork system call to create a duplicate of the currently running program. Key point here is currently running program is duplicated.