This repository was archived by the owner on Jan 25, 2022. It is now read-only.

Description
@pizlonator, @jfbastien, @ogiroux
With the demise of the synchronic proposal (Issue #12) we're back to futexes as the main blocking mechanism. From that comes some further issues we should discuss:
- Efficient locks will likely require some amount of benign spinning and/or micro-waiting before going into the futex.
- The concrete mechanisms for spinning and micro-waiting tend to be platform-dependent; for example, some architectures prefer spin locks to use a relaxation instruction in the loop body; the mechanisms for waiting briefly or simply yielding the scheduler are OS-dependent. If exposed to JS it must be in some abstracted form.
(Further examples of platform variations are here.)
For v1 we can perhaps get away with not providing more than futexes and the ability to spin in a regular loop before going into futexWait, ie, what we already have, but if we know we're going to need more, this would be a good time to have the discussion.
(A related issue is #64, an idea that it is good to allow micro-waiting on the main thread even if we don't allow blocking.)
The first order of business should be to determine whether such a mechanism is required and what its (minimal + nice-to-have) aspects are.