Ch 3 Flashcards
(31 cards)
Process Block
Text section: code
Data: global variables
Heap: dynamically allocated variables
Stack: temporary data (function parameters, return addresses, local variables)

Process States
New. The process is being created.
Running. Instructions are being executed.
Waiting. The process is waiting for some event to occur (such as an I/O completion or reception of a signal).
Ready. The process is waiting to be assigned to a processor.
Terminated. The process has finished execution.

PCB
contains information associated with each process: process state, PC, CPU registers, scheduling information, accounting information, I/O status information

Thread
A thread allows a process to perform one task
job queue
All processes in the system
ready queue
process in main memory ready and waiting for execution
device queue
processes waiting for a particular I/O device
long term vs short term job scheduler
long term scheduler chooses jobs and allocates them into main memrory
short temr scheduler chooses processes ready to execute and allocates them to a CPU (chooses teh degree of multi programing)
medium term scheduling
swapps process form memory and stores into disk to reduce degree of multiprogramming
it saves the state int PCB
Context Switch
context represented in the PCB to restore the state of the process when loaded back into memory after swapping
has time overhead since the CPU does no useful work while switching
Time of a context switch is dependent on hardware
pid
process identifier assigned by either a parent process or the Operating System

cascading termination
A phenomenon where the children are also terminated when the parent is terminated (actually when the child is terminated before the parent)
zombie
A process that has terminated, but whose parent has not yet called wait()
Once the parent calls wait(), the process identifier of the zombie process and its entry in the process table are released.
orphan
when the process’ parent does not call wait and is instead terminated.
IPC
interprocess communication allows for a cooperative process to exchange information
Either message-passing or memory-sharing
shared memory (IPC)
In the shared-memory model, a region of memory that is shared by cooperating processes is established. Processes can then exchange information by reading and writing data to the shared region.

message passing (IPC)
communication takes place by means of messages exchanged between the cooperating processes

socket
an endpoint for communication
defined by an IP address along with a port number
Concatenation of IP address and port
http - port 80
ftp - 21
shared memory systems
Producer
Consumer
bounded buffer
unbounded buffer
message passing systems
direct communication - each process that wants to communicate must explicitly name the recipient or sender of the communication.
(symetric addressing)
send(P, message)—Send a message to process P.
receive(Q, message)—Receive a message from process Q.
(asymetric addressing)
send(P, message)—Send a message to process P.
receive(id, message)—Receive a message from any process. The variable id is set to the name of the process with which communication has taken place.
Indirect Communication - the messages are sent to and received from mailboxes, or ports.
send(A, message)—Send a message to mailbox A.
receive(A, message)—Receive a message from mailbox A.

Message Syncronization
Blocking (synchronous) - The sending process is blocked until the message is received by the receiving process or by the mailbox. The receiver blocks until a message is available.
Nonblocking (asynchronous) - The sending process sends the message and resumes operation. The receiver retrieves either a valid message or a null.
FROM STUDY GUIDE
Blocking is considered synchronous
▪ Blocking send has the sender block until the message is received
▪ Blocking receive has the receiver block until a message is available ◦ Non-blocking is considered asynchronous
▪ Non-blocking send has the sender send the message and continue
▪ Non-blocking receive has the receiver receive a valid message or null
ordinary pipes
One of the first IPC mechanisms in UNIX. Acts as a conduit allowing two processes to communicate.
One write-only end and one read-only end.
Uniderectional
named pipes
are bidirectional
stub
provided to client by an RPC, which hides details that allows communications to take place, it locates port on the servers, marshals the parameters, and transmits/recieves messages to the server