My question is, why the compiler uses parking_lot for Mutex and RwLock? Couldn't they include this implementations of synchronization primitives in the standard library? Quite ironic they need to use an external library for something they themselves are offering
Parking lot is based on the web pack structure of the same name. It has some issues(global allocation table, interface with OS) that make It difficult to use as a standard lock for all platforms. So its unclear if this should be the standard implementation or even can be. A quick answer to your question is they can use internal mutexes and RWlocks. Until recently they were larger and slower then parking lot. This made the tradoff easier but now that STD mutexes have improved its unclear if they should still be using parking lot. Either way many synchronization implementations exist outside the STD in all languages. Like anything else its a tradeoff based on your requirements.
Great talk
My question is, why the compiler uses parking_lot for Mutex and RwLock? Couldn't they include this implementations of synchronization primitives in the standard library? Quite ironic they need to use an external library for something they themselves are offering
Parking lot is based on the web pack structure of the same name. It has some issues(global allocation table, interface with OS) that make It difficult to use as a standard lock for all platforms. So its unclear if this should be the standard implementation or even can be.
A quick answer to your question is they can use internal mutexes and RWlocks. Until recently they were larger and slower then parking lot. This made the tradoff easier but now that STD mutexes have improved its unclear if they should still be using parking lot.
Either way many synchronization implementations exist outside the STD in all languages. Like anything else its a tradeoff based on your requirements.
Sounds a bit like Russel Crowe. Is Nethercote Australian? (yeah, I know, Russel is actually a Kiwi, but still)