-
Notifications
You must be signed in to change notification settings - Fork 44
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
feat(mpz-common): Context::blocking #141
Conversation
fb2cada
to
9ec66f2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I am not sure I understand this PR. A few questions:
This method is needed to avoid deadlocks on single threaded machines.
What is a single-threaded machine and why do we need to support single-threaded machines? Or do you mean a machine with a single CPU core?
The alternative approach is to use an mpsc channel between the worker thread and the calling context, but that doesn't work if single-threaded.
Why doesn't this work?
Yes, I'm referring to single-core CPUs, and generally environments without threading. Not to be confused with our logical thread abstraction in
It does work for The primary purpose of the |
9ec66f2
to
2e7b3ae
Compare
Co-authored-by: dan <[email protected]>
commit 2f35271 Author: sinu.eth <[email protected]> Date: Fri May 31 06:36:31 2024 -0700 feat(mpz-common): scoped! macro (#143) commit 9b51bd4 Author: sinu.eth <[email protected]> Date: Fri May 31 06:35:16 2024 -0700 feat(mpz-common): Context::blocking (#141) * feat(mpz-common): Context::blocking * Apply suggestions from code review Co-authored-by: dan <[email protected]> --------- Co-authored-by: dan <[email protected]> commit 8f0b298 Author: th4s <[email protected]> Date: Fri May 31 10:30:08 2024 +0200 Add IO wrapper for OLE (#138) * Add `mpz-ole` content of old branch. * Reworked message enum. * Refactored to work with new `mpz-ole-core`. * Add part of feedback. * Add more feedback. * Add opaque error type. * Add `Display` for `OLEErrorKind` * Use `ok_or_elese` for lazy heap alloc. * Adapted `mpz-ole` to `hybrid-array`. * WIP: Improving API of const generics... * Add random OT for `hybrid-array`. * Adapt `mpz-ole` to use new random OT. * Added feedback. * Use random OT over field elements instead of arrays. * Refactored ideal implementation to use `mpz-common`. * Added more feedback.
* feat(mpz-common): Context::blocking * Apply suggestions from code review Co-authored-by: dan <[email protected]> --------- Co-authored-by: dan <[email protected]>
* feat(mpz-common): Context::blocking * Apply suggestions from code review Co-authored-by: dan <[email protected]> --------- Co-authored-by: dan <[email protected]>
This PR adds the
Context::blocking
method which supports temporarily moving a context to a separate thread to perform blocking computation. I've also moved the CPU backend shim abstraction intompz-common
.This method is needed to avoid deadlocks on single threaded machines. The alternative approach is to use an
mpsc
channel between the worker thread and the calling context, but that doesn't work if single-threaded.