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

Use AtomicU64 for epochs in 32-bit architectures #433

Open
jeehoonkang opened this issue Oct 16, 2019 · 7 comments
Open

Use AtomicU64 for epochs in 32-bit architectures #433

jeehoonkang opened this issue Oct 16, 2019 · 7 comments

Comments

@jeehoonkang
Copy link
Contributor

@stjepang said:

Just so we don't forget, in all the other places where we have atomic timestamps, we should use AtomicU64 (I believe we can't use wide sequences like in this PR, unfortunately):

  • epoch representation
  • head/tail index in deque, channel, and queues

But that can come later in another PR. It will also require Rust 1.34 minimum.

@jeehoonkang
Copy link
Contributor Author

Since MSRV = 1.36 now, we can use AtomicU64 now: https://doc.rust-lang.org/std/sync/atomic/struct.AtomicU64.html

@taiki-e
Copy link
Member

taiki-e commented Jan 6, 2021

Note that some 32-bit architectures do not support AtomicU64: tokio-rs/tokio#1421 (comment)

@jeehoonkang
Copy link
Contributor Author

Very sad. Do you think it's worth it to use AtomicU64 for those platforms that support it? My opinion is yes, because, e.g., major 32-bit architectures support AtomicU64.

@taiki-e
Copy link
Member

taiki-e commented Jan 6, 2021

I think it's good to use it when AtomicU64 is available, but we have to decide what to do if AtomicU64 is not available.
We can probably use AtomicCell<u64> for this, but performance may be degraded on platforms that AtomicU64 is not available.

@pkubaj

This comment has been minimized.

@taiki-e

This comment has been minimized.

@pkubaj

This comment has been minimized.

bors bot added a commit that referenced this issue Aug 7, 2021
732: Add comment about cfgs to build script r=taiki-e a=taiki-e

cc #731 #433

Co-authored-by: Taiki Endo <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants