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

Support for multithreaded applications #50

Open
hassan-kamaledine opened this issue Jul 25, 2024 · 2 comments
Open

Support for multithreaded applications #50

hassan-kamaledine opened this issue Jul 25, 2024 · 2 comments

Comments

@hassan-kamaledine
Copy link

Hello team, I wanted to inquire about the possibility of adding support for handling sessions in a multi threaded application.
An example of this can be found in the python-pcks11 library.

Since we use this library for its better compatibility with the Thales network HSM, but we faced an issue when using multiple threads with gunicorn we would get the error code CKR_OPERATION_ACTIVE since the thread tried to use a session that was already in use.

@astraw38
Copy link
Contributor

Hi @hassan-kamaledine , It's been a while since I've done pycryptoki with threading. There's nothing built into pycryptoki that is plug-and-play, but there's also nothing that makes it impossible to implement yourself, via a session pool that threads would grab from & use.

@hassan-kamaledine
Copy link
Author

hassan-kamaledine commented Jul 26, 2024

Thanks for the prompt support!

but there's also nothing that makes it impossible to implement yourself, via a session pool that threads would grab from & use.

Yep that is the plan, just wanted to check if it was ever considered to add support for this out of the box.

Have a nice day!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants