Загрузка страницы

Operating System #24 Synchronization: Race Conditions, Critical Section, Locks & Unlocks

Operating System #24 Synchronization: Race Conditions, Critical Section, Locks & Unlocks.
07:42 Race Conditions
• Race conditions
– A situation where several processes access and manipulate the same data (critical section)
– The outcome depends on the order in which the access take place
– Prevent race conditions by synchronization
• Ensure only one process at a time manipulates the critical data. No more than one process should execute in critical section at a time.

09:42 Critical Section
• Any solution should satisfy the following requirements
– Mutual Exclusion : No more than one process in critical section at a given time
– Progress : When no process is in the critical section, any process that requests entry into the critical section must be permitted without any delay
– No starvation (bounded wait): There is an upper bound on the number of times a process enters the critical section, while another is waiting.

10:42 Locks and Unlocks:
• lock(L) : acquire lock L exclusively
– Only the process with L can access the critical section
• unlock(L) : release exclusive access to lock L
– Permitting other processes to access the critical section

When to have Locking?
• Single instructions by themselves are atomic
eg. add %eax, %ebx
• Multiple instructions need to be explicitly made atomic
– Each piece of code in the OS must be checked if they need to be atomic.

Видео Operating System #24 Synchronization: Race Conditions, Critical Section, Locks & Unlocks канала Xoviabcs
Показать
Комментарии отсутствуют
Введите заголовок:

Введите адрес ссылки:

Введите адрес видео с YouTube:

Зарегистрируйтесь или войдите с
Информация о видео
2 сентября 2017 г. 21:19:14
00:14:36
Яндекс.Метрика