Lecture Operating systems: Lesson 22 - Dr. Syed Mansoor Sarwar

Lecture Operating systems: Lesson 22 - Dr. Syed Mansoor Sarwar. The main topics covered in this lesson include: semaphores based solutions for the critical section problem, deadlock and starvation, binary and counting semaphores, synchronization tool, n-processes critical section problem, . | Operating Systems Lecture 22 Syed Mansoor Sarwar Agenda for Today Review of previous lecture Semaphores based solutions for the critical section problem Deadlock and starvation Binary and counting semaphores Recap of lecture 28 April 2022 Copyright Virtual University of Pakistan Review of Lecture 21 The Bakery algorithm Hardware based solutions 28 April 2022 Copyright Virtual University of Pakistan A Good Solution key local lock and waiting global All variables set to false do waiting i true key true while waiting i amp amp key key TestAndSet lock waiting i false 28 April 2022 Copyright Virtual University of Critical Section Pakistan A Good Solution j i 1 n while j i amp amp waiting j j j 1 n if j i lock false else waiting j false Remainder Section 28 April 2022 Copyright Virtual University of Pakistan Solution with Test-And-Set Is the given solution good Yes Mutual Exclusion Satisfied Progress Satisfied Bounded Waiting Satisfied 28 April 2022 Copyright Virtual University of Pakistan Semaphores 28 April 2022 Copyright Virtual University of Pakistan Semaphores Synchronization tool Available in operating systems Semaphore S integer variable that can only be accessed via two indivisible atomic operations called wait and signal 28 April 2022 Copyright Virtual University of Pakistan Semaphores wait S while S 0 no-op S- signal S S 28 April 2022 Copyright Virtual University of Pakistan n-Processes CS Problem Shared data semaphore mutex 1 Structure of Pi do wait mutex critical section signal mutex remainder section while 1 28 April 2022 Copyright Virtual University of Pakistan Is it a Good Solution Mutual Exclusion Yes Progress Yes Bounded Waiting No 28 April 2022 Copyright Virtual University of Pakistan Atomic Execution Uni-Processor Environment Inhibit interrupts before executing code for wait and signal Bus-based Multi-Processor Environment Lock the data bus Use a software solution 28 April 2022 Copyright Virtual University of Pakistan Busy Waiting Processes wait by .

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
98    96    2    20-04-2024
5    89    1    20-04-2024
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.