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

Idea: FpVectorP<2> with concurrent write access #55

Closed
dalcde opened this issue Nov 30, 2021 · 3 comments
Closed

Idea: FpVectorP<2> with concurrent write access #55

dalcde opened this issue Nov 30, 2021 · 3 comments

Comments

@dalcde
Copy link
Contributor

dalcde commented Nov 30, 2021

Since addition mod 2 is xor, we can have multpile threads writing to the same FpVectorP<2> using AtomicU64::fetch_xor. This can be useful for parallelizing certain operations, such as acting on a FreeModule.

This will make the mod 2 situation substantially different from the odd prime situation though. Maybe wait till specialization...

@JoeyBF
Copy link
Collaborator

JoeyBF commented Dec 5, 2021

Are you suggesting we use AtomicU64s as limbs instead of u64s? We could always have something like AtomicFpVector and have it implement BaseVector, assuming #53.

@dalcde
Copy link
Contributor Author

dalcde commented Dec 5, 2021 via email

@dalcde
Copy link
Contributor Author

dalcde commented Mar 26, 2022

I've done a bit of experiment and I think this is just a bad idea. Concurrent atomic writes still incur some synchronization cost, and just makes everything really slow.

@dalcde dalcde closed this as completed Mar 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants