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

Operating System #27 Hardware Locks: Spinlock & its Usage

Operating System #27 Hardware Locks: Spinlock & its Usage
Complete Operating Systems Lecture/ Tutorials from IIT @ https://goo.gl/GMr3if
MATLAB Tutorials @ https://goo.gl/EiPgCF

High Level Constructs
• Spinlock
• Mutex
• Semaphore

15:40 Spinlocks Usage:
• One process will acquire the lock
• The other will wait in a loop repeatedly checking if the lock is available
• The lock becomes available when the former process releases it

Issues with Spinlocks
• No compiler optimizations should be allowed
– Should not make X a register variable
• Write the loop in assembly or use volatile
• Should not reorder memory loads and stores
• Use serialized instructions (which forces instructions not to be reordered)
• Luckly xchg is already implements serialization
• No caching of (X) possible. All xchg operations are bus transactions.
– CPU asserts the LOCK, to inform that there is a ‘locked ‘ memory access
• acquire function in spinlock invokes xchg in a loop…each operation is a bus transaction … huge performance hits.

Видео Operating System #27 Hardware Locks: Spinlock & its Usage канала Xoviabcs
Показать
Комментарии отсутствуют
Введите заголовок:

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

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

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