Latches vs Enqueues.Enqueues permit several concurrent processes to have varying degree of sharing of resources. Any object which can be concurrently used, can be protected with enqueues. The enqueue is obtained using an OS specific locking mechanism. An enqueue allows the user to store a value in the lock.
In latches there is no ordered queue of waiters like in enqueues. Latch waiters may use wakeup timers and retry or spin (only in multiprocessors). Since the processes keep trying concurrently, any process can get the latch. The first process to try might be the last one to get.
|