diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
commit | 36d22d82aa202bb199967e9512281e9a53db42c9 (patch) | |
tree | 105e8c98ddea1c1e4784a60a5a6410fa416be2de /docs/nspr/reference/cached_monitors.rst | |
parent | Initial commit. (diff) | |
download | firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'docs/nspr/reference/cached_monitors.rst')
-rw-r--r-- | docs/nspr/reference/cached_monitors.rst | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/docs/nspr/reference/cached_monitors.rst b/docs/nspr/reference/cached_monitors.rst new file mode 100644 index 0000000000..647bdb1b54 --- /dev/null +++ b/docs/nspr/reference/cached_monitors.rst @@ -0,0 +1,37 @@ +This chapter describes the functions you use when you work with cached +monitors. Unlike a plain monitor, a cached monitor is associated with +the address of a protected object, and the association is maintained +only while the protection is needed. This arrangement allows a cached +monitor to be associated with another object without preallocating a +monitor for all objects. A hash table is used to quickly map addresses +to their respective monitors. The system automatically enlarges the hash +table as needed. + +Important +--------- + +Cached monitors are slower to use than their uncached counterparts. + +See `Monitors <Monitors>`__ for information about uncached monitors. + +.. _Cached_Monitors_Functions: + +Cached Monitors Functions +------------------------- + +Cached monitors allow the client to associate monitoring protection and +state change synchronization in a lazy fashion. The monitoring +capability is associated with the protected object only during the time +it is required, allowing the monitor object to be reused. This +additional flexibility comes at the cost of a small loss in performance. + + - :ref:`PR_CEnterMonitor` enters the lock associated with a cached + monitor. + - :ref:`PR_CExitMonitor` decrements the entry count associated with a + cached monitor. + - :ref:`PR_CWait` waits for a notification that a monitor's state has + changed. + - :ref:`PR_CNotify` notifies a thread waiting for a change in the state of + monitored data. + - :ref:`PR_CNotifyAll` notifies all the threads waiting for a change in + the state of monitored data. |