bustub
bustub copied to clipboard
Switch mutex implementation
pthread lock behaviors are really strange on macOS. Probably we will need something better in BusTub. In Rust we have https://docs.rs/parking_lot/latest/parking_lot/index.html. Thinking of what could be possible for cpp.
~~Or we can drop mac support again...~~
WebKit has something similar: https://github.com/WebKit/webkit/blob/main/Source/WTF/wtf/ParkingLot.h ref: https://webkit.org/blog/6161/locking-in-webkit/
the dependency on parking_lot's impl in webkit is a bit heavy . perhaps we can consider folly (https://sourcegraph.com/github.com/facebook/folly/-/blob/folly/synchronization/Lock.h).