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

Better multithreading #21

Open
ihaveamac opened this issue Jul 25, 2022 · 0 comments
Open

Better multithreading #21

ihaveamac opened this issue Jul 25, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@ihaveamac
Copy link
Owner

Certain parts of pyctr could probably benefit from threading support. One idea I have is to split file reading and de/encryption into two threads with their own locks; since this is mostly IO-bound it should be fine with the GIL (and pycryptodome releases the GIL when doing crypto work).

Per file:

  1. Lock file-reading thread
  2. Read from file (CIA, NCCH, etc.)
  3. Unlock file-reading thread
  4. Pass to decrypt thread
  5. Lock decrypt thread
  6. Decrypt data
  7. Unlock decrypt thread
  8. Return data to main thread

This would allow a file read operation to continue at the same time decryption is happening for another part of the file.

(connected to: ihaveamac/ninfs#94)

@ihaveamac ihaveamac added the enhancement New feature or request label Jul 25, 2022
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

No branches or pull requests

1 participant