diff options
| author | bors <bors@rust-lang.org> | 2024-02-12 09:45:22 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-02-12 09:45:22 +0000 |
| commit | b17491c8f6d555386104dfd82004c01bfef09c95 (patch) | |
| tree | a5989f2b07f7c327915b98df107fe99cc282852d /library/std/src/lib.rs | |
| parent | aebf4511e919e8df6db8a9217fd56316a9f8a38f (diff) | |
| parent | 04282db5b3a980c95e16970447a7cf0c76028bac (diff) | |
| download | rust-b17491c8f6d555386104dfd82004c01bfef09c95.tar.gz rust-b17491c8f6d555386104dfd82004c01bfef09c95.zip | |
Auto merge of #110211 - joboet:queue_lock, r=Amanieu
Replace pthread `RwLock` with custom implementation This is one of the last items in #93740. I'm doing `RwLock` first because it is more self-contained and has less tradeoffs to make. The motivation is explained in the documentation, but in short: the pthread rwlock is slow and buggy and `std` can do much better. I considered implementing a parking lot, as was discussed in the tracking issue, but settled for the queue-based version because writing self-balancing binary trees is not fun in Rust... This is a rather complex change, so I have added quite a bit of documentation to help explain it. Please point out any part that could be explained better. ~~The read performance is really good, I'm getting 4x the throughput of the pthread version and about the same performance as usync/parking_lot on an Apple M1 Max in the usync benchmark suite, but the write performance still falls way behind what usync and parking_lot achieve. I tried using a separate queue lock like what usync uses, but that didn't help. I'll try to investigate further in the future, but I wanted to get some eyes on this first.~~ [Resolved](https://github.com/rust-lang/rust/pull/110211#issuecomment-1513682336) r? `@m-ou-se` CC `@kprotty`
Diffstat (limited to 'library/std/src/lib.rs')
| -rw-r--r-- | library/std/src/lib.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/library/std/src/lib.rs b/library/std/src/lib.rs index 571e475c336..cab3e399ffa 100644 --- a/library/std/src/lib.rs +++ b/library/std/src/lib.rs @@ -339,12 +339,14 @@ #![feature(portable_simd)] #![feature(prelude_2024)] #![feature(ptr_as_uninit)] +#![feature(ptr_mask)] #![feature(slice_internals)] #![feature(slice_ptr_get)] #![feature(slice_range)] #![feature(std_internals)] #![feature(str_internals)] #![feature(strict_provenance)] +#![feature(strict_provenance_atomic_ptr)] // tidy-alphabetical-end // // Library features (alloc): |
