You are on page 1of 83

CHAPTER TWO

Process and Threads

Hawassa University

Compiled by: Kassawmar M.


1
March, 2023
Contents
 Process and Thread
 Process States and Transitions
 Context switching
 Thread implementation
 Interprocess communication
 Concurrent execution: advantages and disadvantages
 Mutual Exclusion, Race conditioning, Critical Sections
 Producer-consumer problems and Synchronization
 Models and mechanisms (interrupt, semaphores, monitors, local
variables)
 Deadlock
 Deadlock prevention
 Deadlock detection
 Deadlock avoidance 2
Process Concept
Process can be defined as:
 A program in execution

 An instance of a program running on a computer.

 The entity that can be assigned to and executed on a processor.

Process need resources like CPU times, memory, files


and I/O devices.

Resources are allocated to processes either


 When it created
3
 While it executed
Cont.…
 Process can be executed in one of the following modes:
 User mode (A user program executes in a user mode)

• User process

 Kernel mode (execute system code at OS)

• Operating system process

The OS is responsible for :-


 Creation and deletion of process

 Scheduling of process

 Interprocess communication

 Dead lock handling for the process.


4
Cont…
 Two essential elements of a process are program
code(which may be shared with other processes that are
executing the same program) and a set of data associated
with that code.

 The information in the preceding list is stored in a data


structure, typically called a process control block (PCB),
that is created and managed by the OS and uniquely
identifies a process.

5
Process…
 The process control block is the key tool that enables the
OS to support multiple processes and to provide for
multiprocessing.

 When a process is interrupted, the current values of the


program counter and the processor registers (context data)
are saved in the appropriate fields of the corresponding
process control block, and the state of the process is
changed to some other value, such as blocked or ready.

6
Process Creation
Events which cause process creation:
 System initialization- When an operating system is booted several
processes are created. These includes:
•Foreground processes- are processes that interact with users and
perform work for them.
•Background processes (daemons)- Processes that stay in the
background to handle some activity .Like a process that accept
incoming email which sleeps most of the day but suddenly
springing to life when email arrives
 Execution of a process creation– new processes can be created after
boot time as well.
 A user request to create a new process

 Initiation of a batch job- Users can submit batch jobs to the system and
OS creates a new process if there is a resource 7
Process Termination
 After a process has been created and does whatever its job is
sooner or later the this process will terminate.
 The process will terminate due to one of the following
condition:
 Normal exit (voluntary) - When processes terminate because
they have done their work, Example, in word processors
when a user clicked the close menu or the close button.
 Error exit (voluntary)- error caused by the process due to a
program bug. Like division by zero
 Fatal error (involuntary)- when a process discovers a fatal
error. E.g trying to read data from an un existing file.
 Killed by another process (involuntary)-when one process
executes a system call telling the operating system to kill
some other process.
8
Process State
 Process may be in one of two states
• Running
• Not-running
 A small dispatcher program is used to switch the processor
from one process to another.
 Two State Process Model

9
9
Cont.…
 A Five-State Model
 A dispatcher program is used to switch the processor from one
process to another.

(b) five-state process model 10


Cont.…
 New: A process that has just been created but has not yet been
admitted to the pool of executable processes by the OS. Typically,
a new process has not yet been loaded into main memory.

 Ready: A process that is prepared to execute when given the


opportunity. The process is waiting to be assigned to a processor.

 Running: The process that is currently being executed.

 Blocked/Waiting: A process that cannot execute until some event


occurs, such as the completion of an I/O operation.

 Terminated: A process that has been released from the pool of


executable processes by the OS, either because it finish the
execution or aborted for some reason. 11
Cont…

12
Queening diagram of 5 state model
Cont.…
 Process description and control example

Figure 2.3: process description and control


13
Implementation of process
 To implement process OS maintain array structure called program control
block
 PCB contain process information like
 Process states
 Process counter
 CPU registers
 CPU scheduling info
 Memory management info
 I/O status info

14
Context Switching
 Context Switching:
• Process of saving the context of one process and loading the
context of other process is known as Context Switching.
• In simple term it is like loading and unloading of process
from running state to ready state.
 When does Context switching happen?
1. When a high priority process comes to ready state,
compared to priority of running process.
2. Interrupt Occurs
3. User and Kernel mode switch: (It is not necessary though)
4. Preemptive CPU scheduling used.

15
Threads
 A thread defines a single sequential execution stream with in a
process.
 Threads are different modules that are presented in a process
 Thread is a light weighted process.
 A basic unit of CPU execution which consists program
counter, thread id, stack and set of registers.

16
Cont…

17
Cont..
 Threads within the same process share memory and files,
they can communicate with each other without invoking
the kernel but not in process.
 Termination of a process, terminates all threads within the
process.
Multithreading
• Operating system supports multiple threads of execution
within a single process.
• MS-DOS supports a single level thread.
• Windows, Solaris, and Linux OS support multiple threads.

18
Thread state
Just like process a thread can have the following states

 New

 Ready
 Running

 Blocked

 Terminated

 Thread transitions are the same with process transition.

19
Thread Usage

 Parallel processing

• We can decompose large process into thread and run in parallel

 Easy to create and destroy

• 100 times faster than creating and destroying process

 Speed up the application

• Utilize the CPU performance

• No need context switch

20
Thread implementation
 Three kinds of thread implementation

 User level thread

 Kernel level thread

 Hybrid implementation

21
Cont.…
User-Level Threads
• All thread management is done by the application programs.
• The kernel is not aware of the existence of threads.
• Implement in user-level libraries, rather than via systems
calls.
• Thread switching does not need to call operating system and
to cause interrupt to the kernel.
• In User-Level Threads, threads library contains codes for:
– creating and destroying threads
– Passing messages and data between threads
– Scheduling thread execution
– Saving and restoring thread context

22
Cont.…

23
Cont.…
User-Level Threads
• Advantages:
– Thread switching do not require operating system.
– Thread scheduling is application specific, without
disturbing the underlying OS scheduler.
– ULTs can run on any OS, need no change to the underlying
kernel to support ULT – use threads library.

• Disadvantages:
– If one thread blocks, the whole process blocks
– Cannot take advantage of multiprocessing – 1 process to 1
processor at a time, i.e. only 1 thread running at a time
24
Cont…
Kernel-Level Threads
 In this method, the kernel knows about and manages the
threads.
 No runtime system is needed in this case. Instead of thread table
in each process, the kernel has a thread table that keeps track of
all threads in the system.
 Operating Systems kernel provides system call to create and
manage threads.
 Kernel maintains context information for the process and the
threads.
 Scheduling is done on a thread basis.
 All calls that blocks threads are implemented as system call

25
Cont…

26
Cont…
Kernel-Level Threads - This approach overcome the
two principal drawbacks of ULT approach
• The kernel can simultaneously schedule threads on
different processors.
• If one thread of a process is blocked it can schedule
another thread of the same process.

The disadvantage
• Transfer of control from one thread to another thread
within the same process requires mode switching,
which is done by the kernel (busy the OS).
27
Cont.…
User level thread kernel level thread
 Implemented by user and  OS managed threads.
managed by run-time system  OS knows about and manages
(user-level library). the thread.
 OS is not aware of existence of  System calls create and manage
threads. threads.
 Creation of thread switching  Slower to create and manage
between thread and
 Run on specific operating
synchronizing thread are all
system.
done via procedural call.
 Fast to create and manage.
 Can run on any operating
system
28
Cont…
Hybrid Approaches
• Combining advantages of user level threads with kernel level
threads
• Thread creation done in the user space
• Bulk of scheduling and synchronization of threads within
application.

29
Thread
Hybrid approaches -Advantage
• Multiple threads within the same application
can run concurrently on a number of
processors.
• Blocking system calls need not block the
entire process.

30
Thread VS Process
 As we mentioned earlier that in many respect threads operate in the
same way as that of processes. Some of the similarities and
differences are:

 Similarities
 Like processes threads share CPU and only one thread active (running)

at a time.

 Like processes, threads within a processes execute sequentially.

 Like processes, thread can create children.

 And like process, if one thread is blocked, another thread can run.
31
Cont.…
Differences
Process Thread
 Process means any program is in  Thread means segment of a process.
execution.  Thread is called light weight process.
 Process is called heavy weight process.  Thread switching does not require to
 Process switching uses interface in call a operating system and cause an
operating system. interrupt to the kernel.
 If one process is blocked then it will  Second thread in the same task
not affect the execution of other could not run, while one server
process. thread is blocked.
 Process takes more time to create and  Thread takes less time to create and
terminate. terminate.
 Process is isolated.  Threads share memory.

32
Interprocess Communication(IPC)
 Processes executing concurrently in the operating system may be
either independent processes or cooperating processes
 Independent process
• Cannot affect or be affected by the other processes executing in the
system
• Does not share data with any other process is independent
 Cooperating
• Can affect or be affected by the other processes executing in the system
• Any process that shares data with other processes is a cooperating
process

33
Cont…
 Processes need to communicate with other processes. for
instance, the output of the first process need to pass to the
second one.
 There are three things here to be considered in IPC:
• How one process can pass information to another?
• How to make sure two or more processes do not get into conflict?
• How to sequence when dependencies are present between
processes? (proper sequencing when dependencies are present).
 The last two concept can be applied for thread also
 IPC facility provides a mechanism to allow processes to
communicate and synchronize their actions.
34
Cont..
 Processes can communicate through:
1. Shared memory
• A region of memory shared by cooperating processes is
established.
• Processes exchange information by write and read data from
the shared memory.
• Processes communicate with each other with resorting to
shared variables.
2. Message passing
• Communication takes place by means of messages
exchanged between cooperating process.
• Processes communicate with each other without resorting to
shared variables.
35
Cont...

Communication
Models

36
Cont…
Message-Passing Systems
• Message system – processes communicate with each other
without resorting to shared variables.

• IPC facility provides two operations:


– Send(message)
– Receive(message)
• If P and Q wish to communicate, they need to:
– establish a communication link between them
– exchange messages via send/receive
• Implementation of communication link
•Direct or indirect communication
•Synchronous or asynchronous communication 37
Cont…
Direct Communication
Communication Process p2
Process p1
Line

Send(p2, message) Receive (p1, message)

• Processes must name each other explicitly:


– send (P2, message) – send a message to process P2
– receive(P1, message) – receive a message from process P1.
• Properties of communication link
– Links are established automatically
– A link is associated with exactly one pair of communicating
processes.
– Between each pair there exists exactly one link
– The link may be unidirectional, but is usually bi-directional.
38
Cont..
Indirect Communication

Mailbox
Process P1 Process P2
M

Send(M, message ) Receive(M, message)

 Messages are directed and received from mailboxes.


• Each mailbox has a unique id
• Processes can communicate only if they share a mailbox
 Properties of communication link
• Link established only if processes share a common mailbox.
• A link may be associated with many processes
• Each pair of processes may share several comm. links
• Link may be unidirectional or bi-directional
39
Cont…
Indirect Communication
• Operations
– create a new mailbox
– send and receive messages through mailbox
– destroy a mailbox
• Primitives are defined as:
send(A, message) – send a message to mailbox A
receive(A, message) – receive a message from
mailbox A

40
Cont…
Indirect Communication
• Mailbox sharing
– P1, P2, and P3 share mailbox A
– P1, sends; P2 and P3 receive
– Who gets the message?
• 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 randomly the receiver.
Sender is notified who the receiver was.

41
Cont.…
Synchronization

• Message passing may be either blocking or non-


blocking
• Blocking is considered synchronous
– Blocking : the sender blocks/inactive until the message
is received.
– Blocking : the receiver blocks until a message is
available.
• Non-blocking is considered asynchronous
– Non-blocking: the sender sends the message and
continue
– Non-blocking: the receiver receives a valid message or
null when it is available.
42
Cont….
Why do processes need to communicate?
 Cooperation:
• Information sharing
o allow concurrent access to shared information

• Computation speedup
o Multiprocessing environment

• Modularity
o Dividing the same function into pieces

• Convenience
o an individual user may work on several task at the same time

 Processes need to communicate in order to cooperate


and work together.
43
CONCURRENCY
The central themes of operating system design are all
concerned with the management of processes and threads.
• Multiprogramming: The management of multiple processes

within a uni-processor system.

• Multiprocessing: The management of multiple processes

within a multiprocessor.

• Distributed processing: The management of multiple


processes executing on multiple distributed computer systems.
44
Cont..
 Concurrency is the execution of multiple instruction sequences at the
same time.
 It happens in the operating system when there are several process or
threads running in parallel.
 The running process threads always communicate with each other
through shared memory or message passing.
 Concurrency in sharing of resources result in problems like
deadlocks and resources starvation.
 It helps in techniques like coordinating execution of processes,
memory allocation and execution scheduling for maximizing
throughput. 45
Cont..
Principles of Concurrency
 In the case of a uniprocessor, the problems stem from a basic
characteristic of multiprogramming systems: The relative speed of
execution of processes cannot be predicted.
 The relative speed execution of process depends on the activities of
other processes, the way in which the OS handles interrupts, and the
scheduling policies of the OS.

Problems in Concurrency
 The sharing global resources
• Sharing of global resources safely is difficult. If two processes both
make use of a global variable and both perform read and write on
that variable, then the order in which various read and write are
executed is critical. 46
Cont..
 Optimal allocation of resources
• It is difficult for the operating system to manage the
allocation of resources optimally.
 Locating programming errors
• It is very difficult to locate a programming error because
reports are usually not deterministic and reproducible.
 Locking the channel
• It may be inefficient for the operating system to simply lock
the channel and prevents its use by other processes.

47
Cont..
What design and management issues are raised by the existence
of concurrency?
 The OS must be able to keep track of the various processes
 The OS must allocate and deal locate various resources for each
active process like:
– Processor time
– Memory
– Files
– I/O devices
 OS must protect the data and physical resources of each process
against unintended interference by other processes.
 The functioning of a process, and the output it produces, must be
independent of the speed at which its execution is carried out
relative to the speed of other concurrent processes.
48
Cont..
Advantages of Concurrency:
 Running of multiple applications- it enable to run multiple
applications at the same time.
 Better resource utilization –It enables that the resources that are
unused by one application can be used for other applications.
 Better average response time –Without concurrency, each
application has to be run to completion before the next one can
be run.
 Better performance –It enables the better performance by the
operating system.
• When one application uses only the processor and another
application uses only the disk drive then the time to run both
applications concurrently to completion will be shorter than the
time to run each application consecutively.
 Reduced waiting, time response time or turnaround time. 49
Cont..
Drawback of Concurrency:
 It is required to coordinate multiple applications through
additional mechanisms.
 Additional performance overheads and complexities in operating
systems are required for switching among applications.
 Sometimes running too many applications concurrently leads to
severely degraded performance.
 It is required to protect multiple applications from one another.

50
Race condition
 Processes that are working together may share some common
storage that each one can read and write.
 A race condition occurs when two or more processes are
reading or writing some shared data, and the final result
depends on who runs precisely.
 A situation in which multiple threads or processes read and
write a shared data item, and the final result depends on the
relative timing of their execution.
 This multiple access is not been properly controlled.
• Print spooler
 The mechanism that prohibits or protect two processes from
accessing shared memory or file at the same time is mutual
exclusion.
51
Critical Region
 Part of program where the shared memory accessed
 A section of code within a process that requires access to shared
resources, and that must not be executed while another process
is in a corresponding section of code.

52
Critical Region
 There are a number of potential solutions to avoid processes
enter the critical section at the same time
 But the solution should meet all the below requirements
 No two processes should be simultaneously in their critical
sections.
 No assumption may be made about the relative speed of the
processes.
 No process running outside its critical section may block other
processes.
 No process should wait forever to enter its critical section.

53
Mutual Exclusion
 The requirement that when one process is in a critical section that
accesses shared resources, no other process may be in a critical
section that accesses any of those shared resources.

54
Cont..

Figure 2-22. Mutual exclusion using critical regions. 55


Cont…
Conditions for Mutual Exclusion
 Mutual exclusion must be enforced:
• Only one process at a time is allowed into its critical section,
 Process that halts in its noncritical section must do so without
interfering with other processes. It must not be possible for a
process requiring access to a critical section to be delayed
indefinitely:
• no deadlock or starvation.
 When no process is in a critical section, any process that requests
entry to its critical section must be permitted to enter without
delay.
 No assumptions are made about relative process speeds or
number of processors.
 A process remains inside its critical section for a finite time only.

56
Cont…
 In mutual exclusion there is:-
 Disabling interrupts
 Lock variable
 Strict alternation
 Peterson’s solutions
 Sleep and Wakeup
 The Producer-Consumer Problem
 Semaphore
 Monitor

57
Disable Interrupts
• Each process disable all interrupts just after entering its
critical region and re-enable them just before leaving it.
• With interrupts disable , no clock interrupts can occur
– so it can examine and update the shared memory
without fear
• It is not attractive solution.
while (true) {
/* disable interrupts */;
/* critical section */;
/* enable interrupts */;
/* remainder */;
}
58
Cont…
• Once a process has disabled interrupts, it can examine and
update the shared memory without fear that any other
process will intervene.
• Limitations:
– Doesn’t work for multiprocessing system.
– unwise to give user processes the power to turn off interrupts.

• Disabling interrupts is often a useful technique within the


operating system itself but is not appropriate as a general
mutual exclusion mechanism for user processes.
59
Lock variables
 The is a shared variable (lock) – initially 0.
 When a process wants to enter critical regions , it first check
the lock.
 If the lock is on, the process should wait otherwise it grants
after making it on. i,e a process changes the lock from 0 to
1 before entering its critical region and changes it from 1 to
0 when it exits.
 If the lock is already 1, it waits until it becomes 0.
Limitations
• If a process is interrupted after reading 0 but before changing
it to 1, may cause race condition.
• Busy-waiting

60
Strict alternation
 The integer variable turn, initially 0,-
 Keeps track of whose turn it is to enter the critical regions
and examine or update the shared memory

 This option requires that the two processes strictly


alternate in entering their critical regions using a
variable.

61
Peterson’s solution
 In 1981, G.L. Peterson discovered a much simpler way to
achieve mutual exclusion.

 His algorithm consists of two procedures.

◦ Requesting permission to enter to the critical region

◦ To indicate that the process leaves the critical region and

allow other process to enter.

62
Sleep and Wakeup
• Busy waiting causes:
– Wasting CPU time
– Priority inversion problem.
• The sleep and wakeup solution intends to resolve the busy
waiting problem.
• Sleep is a system call that causes the caller to block or be
suspended until another process wakes it up.
• The wakeup call has one parameter, the process to be
awakened (wakeup).

63
The Producer-Consumer Problem
• Two processes share a common, fixed-size buffer. One
of them, the producer, puts information into the buffer,
and the other one, the consumer, takes it out.
• Problem
– The producer wants to put a new item in the buffer while the
buffer is full.
• Solution
– The producer to go to sleep, to be awakened when the
consumer has removed one or more items.

64
Cont…
• Problem
– The consumer wants to remove an item from the buffer while the
buffer is empty.
• Solution
– Consumer goes to sleep until the producer puts something in the
buffer and wakes it up.
• To keep track of the number of items in the buffer, we will need
a variable, count.
• If the maximum number of items the buffer can hold is N, the
producer’s code will first test to see if count is N. If it is, the
producer will go to sleep; if it is not, the producer will add an
item and increment count

65
Cont…

else

66
Cont…

67
Cont…
 Race condition may occur – both sleep forever
– The buffer is empty and the consumer has just read count to see if it is
0.
– At that instant, the scheduler decides to stop running the consumer
temporarily and start running the producer.
– The producer inserts an item in the buffer, increments count, and
notices that it is now 1.
– Reasoning that count was just 0, and thus the consumer must be
sleeping, the producer calls wakeup to wake the consumer up.
– the consumer is not yet logically asleep, so the wakeup signal is lost
– When the buffer is full, producer goes to sleep
 BOTH SLEEP FOREVER
– A quick fix is to add a status bit to indicate whether a process is asleep
or awake.

68
Semaphore
 Dijkstra (1965) – suggested using an integer variable to count the
number of walkups saved for the future use.
 The variable is called semaphore.
 A semaphore = 0 , if no wake up saved or some positive value if
one or more wakeups were pending .
 There are two operations on a semaphore
 Down (sleep)
 Up(wakeup)

69
Cont.
1. Down operation
 Equivalent to sleep
 If the value of the semaphore is greater than 0, it uses one
saved wakeup and continues
 At the same time the value of the semaphore is decremented
by one
 If the value is 0, its goes to sleep without completing the
operation.
 Once a semaphore operation has started , no other process can
access the semaphore until the operation has completed or
blocked.
• It solve synchronization problems and race conditions.

70
Cont…
2. Up
 Increments the semaphore.
 If one or more processes were sleeping on that semaphore,
unable to complete an earlier down operation, one of them
is chosen by the system (e.g., at random) and is allowed to
complete its down.
 after an up on a semaphore with processes sleeping on it,
the semaphore will still be 0, but there will be one fewer
process sleeping on it.
 If one or more processes is waiting on this semaphore, wake
up one process
• Reading more about semaphore-increment/decrement-waking
up/sleeping are indivisible atomic operation.
71
Cont…
Solving the Producer-Consumer Problem using Semaphores

Tewodros A.
72
Cont…
Solving the Producer-Consumer Problem using Semaphores

73
Monitors
• Monitor is a collection of procedures, variables, and data
structures that are all grouped together in a special kind of
module or package.
• Processes may call the procedures in a monitor whenever they
want to, but they cannot directly access the monitor’s internal
data structures from procedures declared outside the monitor

• An important property that makes them useful for achieving


mutual exclusion:
– only one process can be active in a monitor at any instant
• Monitors are a programming language construct, so the compiler
knows they are special and can handle calls to monitor
procedures differently from other procedure calls.

74
Cont…
• When a process calls a monitor procedure, the first few
instructions of the procedure will check to see, if any other
process is currently active within the monitor.
• If so, the calling process will be suspended until the other
process has left the monitor.
• If no other process is using the monitor, the calling process may
enter.

75
DEADLOCK

76
DEADLOCK
 Deadlock can be defined as the permanent blocking of a set of
processes that either compete for system resources or communicate
with each other.
 A set of processes is deadlocked when each process in the set is
blocked awaiting an event that can only be triggered by another
blocked process in the set.
 The cause of deadlocks:
◦ Each process needing what another process has. This results from sharing
resources such as memory, devices, locks, links.

77
Cont.…
 All deadlocks involve conflicting needs for resources by two or more
processes.

 Deadlocks can occur when processes have been granted exclusive


access to devices, files, and so on; we will refer to the objects granted
as resources.
 Sequence of events required to use a resource:
– Request the resource.
– Use the resource.
– Release the resource.

 When a process requests for the resource that is been held another
process which needs another resource to continue, but is been held
by the first process, then it is called a deadlock.

 Removing the mutual exclusion condition means that no process will


have exclusive access to a resource.
78
Cont…
Four Conditions for Deadlock
1. Mutual exclusion condition
• only one process at a time can use a resource. No process can
access a resource unit that has been allocated to another
process.
2. Hold and wait condition
• a process holding at least one resource is waiting to acquire
additional resources held by other processes.
3. No preemption condition
• previously granted resources cannot forcibly taken away
4. Circular wait condition
• must be a circular chain of 2 or more processes
• each is waiting for resource held by next member of the chain
79
Deadlock Avoidance
 Deadlock can be avoided by allocating resources carefully.
 Carefully analyze each resource request to see if it can be safely
granted.
 If a system is a safe state = no deadlock.
 unsafe state =deadlock occur.
 It insure that the system will never enter a unsafe state.
 Need algorithm that can always avoided deadlock by making right
choice all the time(Bankers algorithm).
 Bankers algorithm for single resource.
 Bankers algorithm for multiple resource.

 Resource allocation denial- do not grant an incremental resource


request to a process if this allocation might lead to deadlock.
 Process initiation denial- do not start a process if its demands might
lead to deadlock.
80
Deadlock Prevention
 The system lets deadlocks to occur, tries to detect when this happens,
and then takes some action to recover after the fact.
 Prevent deadlock by resource scheduling so as to negate at least one of
the four conditions
1. Attacking the mutual exclusion condition
• Avoid assigning a resource when that is not absolutely necessary, and try
to make sure that as few processes as possible may actually claim the
resource.
2. Attacking the hold and wait condition
• If we can prevent processes that hold resources from waiting for more
resources, we can eliminate deadlocks.

81
Cont.…
• One way to achieve this goal is to require all processes to request
all their resources before starting execution
 If everything is available, the process will be allocated whatever it
needs and can run to completion.
 If one or more resources are busy, nothing will be allocated and the
process would just wait.
3. Attacking the no preemption condition
• Resources can’t be preempted. A resource can be released by the
process holding it after that process has completed its task.
4. Attacking the circular wait condition
• circular wait can be eliminated in several ways:
o a process is entitled only to a single resource at any moment
o provide a global numbering of all the resources, all requests must be
made in numerical order

82
1-
83

83

You might also like