2 ms·
The easy way to solve concurrency problems is just put a lock on the whole thing. It is trivial to get that right. And if the actual demand for concurrency is
by PaulHoule 1y ago
The easy way to solve concurrency problems is just put a lock on the whole thing. It is trivial to get that right. And if the actual demand for concurrency is low this is fine. A two processor machine doesn’t spend much time running the OS kernel so circa 2000 Linux had a giant kernel lock on the whole kernel.
If you increase the number of CPUs though this became an increasing bottleneck and IBM did some really amazing work to make Linux scalable. Trouble is you now have to lock on smaller resources and the various combinations of things that could get locked increases the complexity exponentially. From the viewpoint of a user space developer the locking facilities under POSIX aren’t that good and move the tradeoff between “sometimes waiting for a lock” vs “dealing with data corruption” towards the former.