pmmp / ext-pmmpthread

Fork of https://github.com/krakjoe/pthreads with a revamped API and PHP 8.1+ support
Other
81 stars 17 forks source link

Create persistent copies of classes when they are loaded, instead of when they are used #62

Open dktapps opened 3 years ago

dktapps commented 3 years ago

Currently, pthreads makes copies of classes when a new thread is started. This is a problem for numerous reasons:

We can avoid all of these issues by copying the class to persistent memory when it is loaded, exactly the same way that OPcache does.

polyphia commented 3 years ago

Could this be related to https://github.com/pmmp/pthreads/issues/63 ?

dktapps commented 3 years ago

This isn't a bug report, so it's not related that way, no. I have no idea what's behind #63 since I haven't investigated it yet.

polyphia commented 3 years ago

Alright thanks for updating, just considering the possibitily of having to copy classes causing an extra delay in Pool::Submit , which seems to be aligned with the https://github.com/pmmp/pthreads/issues/63 issue disappearing when opcache cli is enabled .