Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Halting development of pthreads for 7.4 #929
I'm aware that this is going to annoy some people, so apologies before we begin ...
I do not intend to maintain pthreads anymore, nor encourage it's maintenance: It is, in my opinion, broken by design, and fixing it, is simply not worth it.
The internals world is changing fast and pthreads is not going to be able to fit into that world. It is highly complicated, too difficult to deploy and understand, and slow, necessarily so because of the API it tries to provide. When we get a JIT, we will be in a position where it is much faster to execute your CPU bound code in one normal thread, than distributing that work across many pthreads. There is nothing that can be done to help pthreads while it has the API it has, it's possible that the way pthreads works will actually prohibit the JIT from compiling code. Everything about pthreads is putting it in an untenable position for the future.
I've started work on a new extension that will be compatible with the future: https://github.com/krakjoe/parallel
While it is not compatible with pthreads, and will not be, I view it as the only viable replacement for the versions of PHP to come, and my focus has to be on that.
When 7.4 goes into RC stage near the end of this year, this repository will be archived, and no further releases of pthreads will occur on PECL or from this repository.
Thanks for all the effort that contributors have put into pthreads, you've worked hard and I appreciate that, and I would ask that anyone with a focus on pthreads internals today shifts that focus to the future and parallel.