5 ms·
Obviously there's no avoiding this, but the author writes in the context of high-level code where OS-provided locking mechanisms are available. Why are we discu
by tdrd 14y ago
Obviously there's no avoiding this, but the author writes in the context of high-level code where OS-provided locking mechanisms are available. Why are we discussing this in a low-level (or embedded, where every ounce of performance matters) context?
- psobot 14y agoYou don't need to be embedded to have performance matter - even if your OS gives you concurrency primitives, there are many situations where jumping into kernel code is still "too expensive."
- justincormack 14y agoThat's why Linux has the futex which is userspace only if not contended only jumps to kernel code for the contended case.
- pcwalton 14y agoThere are many situations in which OS-level primitives such as blocking semaphores are available but userland primitives are not. When implementing libc, for example. Or when implementing a language runtime, or TBB, or boost::thread_pool, or what have you.
- ucee054 14y agoBecause the author works in embedded