bustub icon indicating copy to clipboard operation
bustub copied to clipboard

Switch mutex implementation

Open skyzh opened this issue 2 years ago • 3 comments

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.

skyzh avatar Oct 26 '22 21:10 skyzh

~~Or we can drop mac support again...~~

lmwnshn avatar Oct 26 '22 23:10 lmwnshn

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/

c8ef avatar Nov 19 '22 07:11 c8ef

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).

infdahai avatar Mar 27 '23 15:03 infdahai