This shows you the differences between two versions of the page.
|
dido:public:ra:xapend:xapend.a_glossary:r:resource_lock [2021/11/01 15:06] nick created |
dido:public:ra:xapend:xapend.a_glossary:r:resource_lock [2021/11/01 15:08] (current) nick |
||
|---|---|---|---|
| Line 7: | Line 7: | ||
| A (binary) semaphore is the simplest type of lock. In terms of access to the data, no distinction is made between shared (read only) or exclusive (read and write) modes. Other schemes provide for a shared mode, where several threads can acquire a shared lock for read-only access to the data. Other modes such as exclusive, intend-to-exclude and intend-to-upgrade are also widely implemented. | A (binary) semaphore is the simplest type of lock. In terms of access to the data, no distinction is made between shared (read only) or exclusive (read and write) modes. Other schemes provide for a shared mode, where several threads can acquire a shared lock for read-only access to the data. Other modes such as exclusive, intend-to-exclude and intend-to-upgrade are also widely implemented. | ||
| + | |||
| + | Locks typically require hardware support for efficient implementation. This usually takes the form of one or more atomic instructions such as "test-and-set", "fetch-and-add" or "compare-and-swap". These instructions allow a single process to test if the lock is free, and if free, acquire the lock in a single atomic operation. | ||
| Source: [[https://en-academic.com/dic.nsf/enwiki/153136 ]] | Source: [[https://en-academic.com/dic.nsf/enwiki/153136 ]] | ||