3 ms·
> Consequently, the overhead present in the win32 API is basically just dead-weight, there to make sure that "things are safe by default". How much overhead is
by lmm 2y ago
> Consequently, the overhead present in the win32 API is basically just dead-weight, there to make sure that "things are safe by default".
How much overhead is it though? IIRC uncontended mutexes are practically free, especially when they're only being used from a single thread.
Our industry is way too eager to make things unsafe for the sake of marginal performance differences that are irrelevant for most use cases, IMO.
- xxs 2y agouncontended mutexes are very cheap but not free. lock cmpxchg has way higher latency (and coherency traffic) costs than a simple move or (xchg). Java had lock elision, effectively trying to solve the hardware problem in software back in mid 00s. There are optimizations to be made it running on a single core (no need for the lock), e.g. docker with taskset