9.7 Agents
An agent comprises a set of ECMAScript
An
Some web browsers share a single
While an
An agent signifier is a globally-unique opaque value used to identify an
Field Name | Value | Meaning |
---|---|---|
[[LittleEndian]] | a Boolean | The default value computed for the isLittleEndian parameter when it is needed by the algorithms |
[[CanBlock]] | a Boolean | Determines whether the |
[[Signifier]] | an |
Uniquely identifies the |
[[IsLockFree1]] | a Boolean | |
[[IsLockFree2]] | a Boolean | |
[[IsLockFree8]] | a Boolean | |
[[CandidateExecution]] | a |
See the |
[[KeptAlive]] | a |
Initially a new empty |
Once the values of [[Signifier]], [[IsLockFree1]], and [[IsLockFree2]] have been observed by any
The values of [[IsLockFree1]] and [[IsLockFree2]] are not necessarily determined by the hardware, but may also reflect implementation choices that can vary over time and between ECMAScript implementations.
There is no [[IsLockFree4]] field: 4-byte atomic operations are always lock-free.
In practice, if an atomic operation is implemented with any type of lock the operation is not lock-free. Lock-free does not imply wait-free: there is no upper bound on how many machine steps may be required to complete a lock-free atomic operation.
That an atomic access of size n is lock-free does not imply anything about the (perceived) atomicity of non-atomic accesses of size n, specifically, non-atomic accesses may still be performed as a sequence of several separate memory accesses. See
An
9.7.1 AgentSignifier ( )
The abstract operation AgentSignifier takes no arguments and returns an
- Let AR be the
Agent Record of thesurrounding agent . - Return AR.[[Signifier]].
9.7.2 AgentCanSuspend ( )
The abstract operation AgentCanSuspend takes no arguments and returns a Boolean. It performs the following steps when called:
- Let AR be the
Agent Record of thesurrounding agent . - Return AR.[[CanBlock]].
In some environments it may not be reasonable for a given