Standard library, synchronization primitives, and undefined behavior

#21

@Amanieu Are you going to write an RFC? What can we do to help push this forward?

2 Likes

#22

There is a PR for using the parking_lot code inside of libstd now: https://github.com/rust-lang/rust/pull/56410

10 Likes

#23

If/when this PR is adopted, the Rust cheat sheet will need to be updated for Mutex<T>, since the new parking_lot code does not have a poison field. That would also be a good opportunity to add the missing RwLock<T> to the cheat sheet.

0 Likes

#24

Even with that PR, Mutex will remain backwards-compatible and hence still have poison. It will just use the parking_lot machinery for implementing mutual exclusion, instead of leaving that to OS primitives.

2 Likes

#25

I would absolutely love to update the cheat sheet if a consequence of this work is that the Box is removed. My understanding is that the Box is primarily to ensure that the OS primitive is not moved, and with parking_lot that goes away.

0 Likes

closed #26

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.

0 Likes