pmmp / ext-pmmpthread

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

Added Thread::getSharedGlobals() - ThreadSafeArray automatically available to all threads #116

Closed dktapps closed 1 year ago

dktapps commented 1 year ago

this is a ThreadSafeArray automatically available to all threads unconditionally.

Implements #80

This is useful for automatically inheriting data between threads without using tmp.

However, I'm not sure if an auto global is necessarily the best solution for this. It's a pain to document.