Remix.run Logo
tiffanyh 7 hours ago

> Replaced the cas spinlock in kernel mutexes with a "parking" lock.

Anyone know what a "parking lock" is (and how it works)?

I couldn't find anything on the man pages about it.

https://man.openbsd.org/OpenBSD-5.5/lock.9

https://man.openbsd.org/OpenBSD-5.9/mutex.9

sanxiyn 7 hours ago | parent | next [-]

"Parking" lock is a reference to this:

https://webkit.org/blog/6161/locking-in-webkit/

tiffanyh 7 hours ago | parent [-]

Thanks!

Wow, this is from 10-years ago.

packetlost 7 hours ago | parent | prev [-]

It's a lock/mutex implementation that puts the blocked thread to sleep, usually via cooperative yielding to the scheduler instead of continuing to perform CAS operations on the lock continuously. Spinlocks have great performance when they're not heavily contended and the locks are held for short periods of time, but if either of those things are true the blocked thread can easily consume an entire CPU core while it's blocked.