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

Thread-safety: replace buffers thread-safe pools #537

Draft
wants to merge 21 commits into
base: main
Choose a base branch
from

Conversation

lehugueni
Copy link
Contributor

@lehugueni lehugueni commented Jan 23, 2025

This PR replaces the temporary buffers stored in objects with thread-safe pools that can be used to obtain temporary objects.

  • Added the structs.BufferPool interface and structs.SyncPool, structs.BuffFromUintPool that implement it.
  • Modify ring.Ring so that it stores a structs.SyncPool[*[]uint64]
  • Add methods that build pools of ring.Poly, ringqp.Poly and rlwe.Ciphertext from structs.SyncPool[*[]uint64]
  • Replace buffers with these pools in all non-thread-safe structures of FHE:
    • rlwe.Evaluator
    • rlwe.Decryptor
    • ring.BasisExtender
    • ckks.Evaluator
    • ckks.Encoder
    • bgv.Evaluator
    • bgv.Encoder
    • sampler.Gaussian
    • sampler.Uniform
    • rlwe.Encryptor
    • rlwe.KeyGenerator
  • Replace buffers with pools in all non-thread-safe structures of MHE
  • Add tests for correctness of concurrent executions
  • Remove ShallowCopy functions

@lehugueni lehugueni added the enhancement New feature or request label Jan 23, 2025
@lehugueni lehugueni self-assigned this Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant