You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 16, 2019. It is now read-only.
Hello, this is not an issue or bug. This is the question related to pthreads extension. So I hope I may ask here.
I have a difficult task, creating php extension (I will call it custom-extension) with libssh2. Extension must work with pthreads together. Let's say I have 100 php threads. As I see all threads has the same custom-extension instance. And, as I think, this is why I get a lot problems when I use more then 1 thread. For example global variables in custom-extension C code will be owerwritten by pthreads. Sure, I may use __thread, but it doesn't solve the problem. Libssh2 usage in custom-extension makes things more difficult. I will not provide any code, because I think it doesn't matter.
So the question is: is it possible to make each php pthread use own new custom-extension instance ? I think it will be better for my case, because then I will encapsulate custom-extension for each thread. Also libssh2, used in custom-extension also should be new instance for each thread. This way has to save me for variables overwritting and other segfaults errors.
So maybe I should just compile custom-extension with some flag to get the goal ? I think I have to make own custom-extension instance for each thread to satisfy shared-nothing rule.