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

Flexible solver/scrambler lifetime management #92

Open
lgarron opened this issue Jan 12, 2025 · 0 comments
Open

Flexible solver/scrambler lifetime management #92

lgarron opened this issue Jan 12, 2025 · 0 comments
Labels

Comments

@lgarron
Copy link
Member

lgarron commented Jan 12, 2025

For the commandline, FFI, and most basic use cases, a lazy static "singleton" for each scrambler is probably fine:

static ref SQUARE1_SOLVER: Mutex<Square1Solver> = Mutex::new(Square1Solver::new());

However:

  • We may want to provide an API call to deallocate a given scrambler if the caller would rather free the resources.
  • We need to expose an API to provide access to the scramblers themselves, so the caller can e.g. configure them, run them in parallel/interleave them/run them on different threads.

Being able to free all (well, almost all) memory after generating scrambles is also a good litmus that we have a good, safe architecture.

@lgarron lgarron added the rust label Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant