Amanieu / intrusive-rs

Intrusive collections for Rust
Apache License 2.0
422 stars 50 forks source link

Add atomic links for all data structures #66

Closed charpercyr closed 2 years ago

charpercyr commented 2 years ago

The goal of this PR is to add atomic Link types for every data structure that can be shared between threads.

Every link type implements acquire_link and release_link using atomic operations. The rest of the operations on the links are implemented using non-atomic operations, assuming that acquire_link has already been called.

All the AtomicLink types are Send and Sync.

The atomic link types all have the same size as their non-atomic counterpart. This relies on these assumptions:

Amanieu commented 2 years ago

Great work!