struct sysv_sem {

struct sem_undo_list *undo_list;

The only member, undo_list, is used to permit semaphore manipulations that can be undone. If a process crashes after modifying a semaphore, the information held in the list is used to return the semaphore to its state prior to modification. The mechanism is useful when the crashed process has made changes after which processes waiting on the semaphore can no longer be woken. By undoing these actions (using the information in the undo list), the semaphore can be returned to a consistent state, thus preventing deadlocks. I won't bother with the details here, however.

sem_queue is another data structure that is used to associate a semaphore with a sleeping process that wants to perform a semaphore operation but is not allowed to do so at the moment. In other words, each instance of the data structure is an entry in the list of pending operations.

Continue reading here: Info

Was this article helpful?

0 0