- no cycle IMPLIES no deadlock
- deadlock IMPLIES cycle (necessary condition)
- cycle IMPLIES maybe deadlock (but not sufficient condition)
single instance resource AND cycle IMPLIES deadlock - (necessary and sufficient





-An algorithm that periodically whether a deadlock has occured in the system
-a procedure to recover
-one instance per resource type.
-multiple instances per resource type
Deadlock Prevention.
Deadlock Avoidance.
Deadlock Detection.
Ignore the problem...
First Come, First Served (FCFS)
>> Non-preemptive
>> Treats ready queue as FIFO.
>> Simple, but typically long/varying waiting time.
Shortest Job First (SJF)
>> Give CPU to the process with the shortest next burst
>> If equal, use FCFS
>> Better name: shortest next cpu burst first
Priority Scheduling Algorithms
>> Priority associated with each process
>> CPU allocated to the process with highest priority
>> If equal, use FCFS
=> Internal Priority (time limits, mem requirements, number of open files)
=>External Priority (Critera outside the OS. Choice related to computer usage)
Round-Robin (RR)
>> FCFS with Preemption
>> Time quantum (or time slice)
>> Ready Queue treated as circular queue
Linux Threads
[ ] >Linux refers to them as tasks rather than threads
[ ] >Thread creation is done through clone() system call
[ ] >Clone() allows a child task to share the address space of the parent task (process)
Windows XP Threads
[ ]>Implements the one-to-one mapping
[ ]>Each thread contains
[ ]>A thread id
{}Register set
{}Separate user and kernel stacks
{}Private data storage area
[ ]>The register set, stacks, and private storage area are known as the context of the threads
[ ]>The primary data structures of a thread include:
{}ETHREAD (executive thread block)
{}KTHREAD (kernel thread block)
{}TEB (thread environment block)
Java Thread
> Extending thread class
> Implementing the Runnable inteface