1. Trang chủ
  2. » Công Nghệ Thông Tin

Lecture Operating systems: Internals and design principles (6/E): Chapter 6 - William Stallings

51 41 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 51
Dung lượng 602,96 KB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

Chapter 6 - Concurrency: Deadlock and starvation. This chapter examines two problems that plague all efforts to support concurrent processing: deadlock and starvation. We begin with a discussion of the underlying principles of deadlock and the related problem of starvation. Then we examine the three common approaches to dealing with deadlock: prevention, detection, and avoidance.

Trang 1

Chapter 6 Concurrency: Deadlock and

©2008, Prentice Hall

Trang 2

that either compete for system resources

or communicate with each other

• No efficient solution

two or more processes

Trang 3

Deadlock

Trang 6

Reusable Resources

not depleted by that use

release for reuse by other processes

Trang 7

Reusable Resources

secondary memory, devices, and data structures such as files, databases, and semaphores

one resource and requests the other

Trang 8

Reusable Resources

Trang 9

• Space is available for allocation of

200Kbytes, and the following sequence of events occur

progress to their second request

P1

. .  . . .

Request 80 Kbytes;

Request 60 Kbytes;

P2

. .  . . .

Request 70 Kbytes;

Request 80 Kbytes;

Trang 10

Consumable Resources

(consumed)

information in I/O buffers

is blocking

cause deadlock

Trang 11

Example of Deadlock

P1

. .  . . .

Receive(P2);

Send(P2, M1);

P2

. .  . . .

Receive(P1);

Send(P1, M2);

Trang 12

Resource Allocation Graphs

system of resources and processes

Trang 13

Conditions for Deadlock

Trang 14

Conditions for Deadlock

Trang 15

Resource Allocation Graphs

Trang 19

Deadlock Prevention

– Must be supported by the OS

– Require a process request all of its required resources at one time

Trang 20

Deadlock Prevention

– Process must release resource and request again

– OS may preempt a process to require it

releases its resources

– Define a linear ordering of resource types

Trang 21

Deadlock Avoidance

the current resource allocation request will, if granted, potentially lead to a

deadlock

requests

Trang 22

Two Approaches to Deadlock Avoidance

might lead to deadlock

request to a process if this allocation might lead to deadlock

Trang 23

Resource Allocation Denial

allocation of resources to process

sequence that does not result in deadlock

Trang 24

Determination of a Safe State

Trang 28

Determination of an Unsafe

State

Trang 29

Deadlock Avoidance Logic

Trang 32

Deadlock Detection

Trang 33

Strategies Once Deadlock

Detected

some previously defined checkpoint, and restart all process

– Original deadlock may occur

Trang 34

Strategies Once Deadlock

Detected

until deadlock no longer exists

deadlock no longer exists

Trang 35

Advantages and Disadvantages

Trang 36

Dining Philosophers Problem

Trang 41

UNIX Concurrency Mechanisms

Trang 42

UNIX Signals

Trang 43

Linux Kernel Concurrency

Mechanism

UNIX

interruption and without interference

Trang 44

Linux Atomic Operations

Trang 46

Linux Spinlocks

Trang 47

Linux Semaphores

Trang 48

Linux Memory Barrier

Operations

Trang 49

Solaris Thread Synchronization

Trang 50

Solaris Synchronization Data

Structures

Trang 51

Windows Synchronization

Objects

Ngày đăng: 30/01/2020, 03:12

TỪ KHÓA LIÊN QUAN