Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not provide AtomicCell when cfg(crossbeam_loom) is enabled #787

Merged
merged 1 commit into from Feb 9, 2022

Conversation

taiki-e
Copy link
Member

@taiki-e taiki-e commented Feb 9, 2022

We cannot provide AtomicCell under cfg(crossbeam_loom) because loom's atomic types have a different in-memory representation than the underlying type. (tokio-rs/loom#253)

pub struct AtomicCell<T: ?Sized> {
/// The inner value.
///
/// If this value can be transmuted into a primitive atomic type, it will be treated as such.
/// Otherwise, all potentially concurrent operations on this data will be protected by a global
/// lock.
value: UnsafeCell<T>,
}

fyi @jonhoo

Comment on lines +27 to +30
// We cannot provide AtomicCell under cfg(crossbeam_loom) because loom's atomic
// types have a different in-memory representation than the underlying type.
// TODO: The latest loom supports fences, so fallback using seqlock may be available.
#[cfg(not(crossbeam_loom))]
Copy link
Member Author

@taiki-e taiki-e Feb 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Well, this todo may be difficult because seqlock has another issue.)

@taiki-e
Copy link
Member Author

taiki-e commented Feb 9, 2022

bors r+

@bors
Copy link
Contributor

bors bot commented Feb 9, 2022

Build succeeded:

@bors bors bot merged commit 8ed251b into master Feb 9, 2022
@bors bors bot deleted the loom-atomic-cell branch February 9, 2022 17:05
bors bot added a commit that referenced this pull request Mar 15, 2022
800: Prepare for the next release r=taiki-e a=taiki-e

- crossbeam-channel 0.5.2 -> 0.5.3
  - Fix panic on very large timeout. (#798)
- crossbeam-epoch 0.9.7 -> 0.9.8
  - Make `Atomic::null()` const function at 1.61+. (#797)
- crossbeam-queue 0.3.4 -> 0.3.5
  - Add `ArrayQueue::force_push`. (#789)
- crossbeam-utils 0.8.7 -> 0.8.8
  - Fix a bug when unstable `loom` support is enabled. (#787)


Co-authored-by: Taiki Endo <te316e89@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

1 participant