Topic #3: Threads and Processes Flashcards
It is an abstraction of a running program, an activity of some kind
Process
It is a series of instructions for a computer to perform that may be stored on a disk
Program
It is the rapid switching back and forth of pseudo parallel sequential processes
Multiprogramming
Events which cause Processes Creation
- System Initialization
- Execution of a process creation system call by a running process
- a user request to create a new process
- initiation of a batch job
Events which cause Termination
Normal Exit (Voluntary)
Error Exit (Voluntary)
Fatal Error (Involuntary)
Killed by another process (Involuntary)
Three States a process may be in
Running
Ready
Blocked
A state that a process can be in that refer to actually using the CPU at that instant
Running
A state that a process can be in that refers to a runnable or a temporarily stopped process to let others run
Ready
A state that a process can be in wherein it is unable to run until some external event happpens
Blocked
It is where information that must be saved when the process is switched from running to ready or blocked state so that it can be restarted later
Process table
Other name for Processs Table
Process Control Blocks
How many entries are there per process
One entry per process
It contains the address of the interrupt service procedure
Interrupt Vector
It is a signal emitted by a device attached to a computerr or a from a program that requires the OS to stop and figure out what to do next
Interrupt
These are sometimes referred to as lightweight processes
Threads
It is the situation that allows multiple threads to run within the same process
Multithreading
Advantages of Threads
- threads are more responsive as it executes an output and can be immediately returned
- context switch time between threads is lower
- multiple threads can be scheduled on multiple processor
- resources can be shared among all threads in a process
- communication between threads is eeasier as they share an address space
- multiple threads = multiple jobs = multiple completion = increased throughput
It is the thread package defined by the IEEE to make it possible to write protable threaded programs
Pthreads
It is a thread call that creates a new thread
Pthread_create
It is a thread call that terminates the calling thread
Pthread_exit
It is a thread call that waits for a specific thread to exit
Pthread_join