Beruflich Dokumente
Kultur Dokumente
Process Concept Process Scheduling Operation on Processes Cooperating Processes Interprocess Communication Buffering
4.1
Process Concept
A process includes:
program counter specifying next instruction to be executed. Stack containing temporary data such as return address. data section containing global variables.
Operating System Concepts 4.2
Process State
4.4
4.5
4.6
4.7
4.8
4.9
4.10
Schedulers
Schedulers (Cont.)
4.12
4.13
Schedulers (Cont.)
If all processes are I/O bound, the ready queue will almost
always be empty and the short-scheduler will have little to do.
If all processes are CPU bound, the I/O waiting queue will
almost always be empty, devices will go unused, and the system will be unbalanced.
4.14
Context Switch
Context-Switch Time depends on hardware support. Context-Switch Speed varies from machine to
machine depending on memory speed, number of registers copied. The speed ranges from 1 to 1000 microsecond.
4.15
Process Creation
4.16
UNIX examples
fork system call creates new process execve system call used after a fork to replace the process memory space with a new program.
Operating System Concepts 4.17
4.18
Process Termination
4.19
Cooperating Processes
4.20
10
Threads
11
Threads (Cont.) In a multiple threaded task, while one server thread is blocked
and waiting, a second thread in the same task can run. Cooperation of multiple threads in same job confers higher throughput and improved performance. Applications that require sharing a common buffer benefit from thread utilization.
Kernel-supported threads (Mach and OS/2). User-level threads; supported above the kernel, via a set of
library calls at the user level (Project Andrew from CMU).
Hybrid approach implements both user-level and kernelsupported threads (Solaris 2).
4.23
threads
Program counter
Data Segment
Operating System Concepts
4.24
12
IPC is best provided by message-passing systems. IPC facility provides two operations:
send(message) message size fixed or variable receive(message)
Implementation Questions
How are links established? Can a link be associated with more than two
processes?
What is the capacity of a link? Is the size of a message that the link can
accommodate fixed or variable?
4.26
13
Direct Communication
Indirect Communication Messages are directed and received from mailboxes (also referred
to as ports). Each mailbox has a unique id. Processes can communicate only if they share a mailbox.
4.28
14
Solutions:
Allow a link to be associated with at most two processes. Allow only one process at a time to execute a receive operation. Allow the system to select arbitrarily the receiver. Sender is notified who the receiver was.
Operating System Concepts 4.29
Buffering
4.30
15