4 ms·
parking_lot is a mutex. slab is a slab allocator. It seems to me that in a C or C++ project you’d have everyone writing their own rather than a shared project t
by nicoburns 5y ago
parking_lot is a mutex. slab is a slab allocator. It seems to me that in a C or C++ project you’d have everyone writing their own rather than a shared project that everyone depends on.
Personally I have much more confidence in the community de facto standard implementation of something than I do in the half-baked version that someone writes themselves to avoid pulling in a dependency.
- platinumrad 5y agoPersonally I think it's a good thing when my hello world program is vulnerable to 65 different supply chain attacks.
- nonameiguess 5y agoNot sure why a C project would do that from scratch. libc includes that functionality, so you already get it for free in any POSIX system. In Windows, I'm sure the system C library provides the same stuff.
- nicoburns 5y agoPerhaps not those things, but I see lots of C projects with custom hash map implementations, etc.
- gpderetta 5y agoI don't think parking_lot is a mutex. It is more similar to a futex, i.e. an ephemeral wait queue. You can use it to implement a mutex, but that's just one use case.