A little debug showed that the only problem is file handle (result of "fopen").
It is valid only inside the function where it was initialized. I.e. it is impossible to store file handle in a class variable or pass it to another function.
I fixed this problem by simply making all lib-classes "extends Threaded".
However, php-lib is too slow and I need php-extension.
Code of extension is very similar to php-lib. And according to error-type the reason for the problem is also same - file handles.
Any suggestions how to rewrite C-code of extension to do the same trick? Or some better way )
PHP 7.2.7 + pthreads master
MaxMind php-lib fails inside threads ("extends Thread").
A little debug showed that the only problem is file handle (result of "fopen"). It is valid only inside the function where it was initialized. I.e. it is impossible to store file handle in a class variable or pass it to another function.
I fixed this problem by simply making all lib-classes "extends Threaded".
However, php-lib is too slow and I need php-extension. Code of extension is very similar to php-lib. And according to error-type the reason for the problem is also same - file handles.
Any suggestions how to rewrite C-code of extension to do the same trick? Or some better way )