Ask Your Question
2

Is it possible for multiple Ruby threads to use the same instance of OpenSSL::PKey::RSA object?

asked 2021-04-10 11:00:00 +0000

ladyg gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2021-12-04 04:00:00 +0000

qstack gravatar image

Yes, it is possible for multiple Ruby threads to use the same instance of OpenSSL::PKey::RSA object. However, care must be taken to ensure that the object is accessed in a thread-safe manner to prevent any race conditions or shared state issues. It is recommended to use locks or mutexes to synchronize access to the object between threads. Another approach could be to create a pool of initialized objects that can be shared by multiple threads.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2021-04-10 11:00:00 +0000

Seen: 11 times

Last updated: Dec 04 '21