Hello, I use pthreads and APC on my project.
When I start my file with hhvm, I get error : "Thread class not found", HHVM don't support php pthreads ?
Thanks in advance
Sorry, we don't currently support pthreads.
Is in to-do list ?
Yep, github issues are the todo list.
+1
+1
+1,000
+1
+1
+1
+1
This is something we are interested in having in some form. Currently the way requests are implemented isn't thread safe, and getting this to work will likely require support from the on-going GC project. I doubt it's something we'll be ready to invest time in soon.
@paulbiss Requests are safe or not ? - 5 months ago, the requests are thread safe, but now not? see https://github.com/facebook/hhvm/issues/4719
Correct my, if i am wrong, but you have several threading capabilities implemented, e.g. pagelet server, xbox tasks, rpc, etc.?! - Everything looks like threading is nothing new to HHVM and maybe this should be good starting points (ideas...) to porting pthreads to HHVM or?
Same story as 5 months ago: for each request, PHP code for one request always executes in the same thread, so thread-safety is not an issue.
Pagelets and xbox etc are implemented as extra requests, without sharing context, so thread-safety is still not an issue there.
UP ? PHP7/PHPNG will support it. Maybe @krakjoe will work on HHVM compatible version
I don't know enough about HHVM to do that, and am super busy on 7 related stuff, so don't have the time to learn ...
+1 for threading support, I don't care if Zend won't do it. HACK should do it.
Closing this, as if this happens, it's almost certainly going to come in one of two ways:
As our needs are somewhat specialized, if we try to design and implement something useful for others we're likely to not have the right context and accidentally make something useless that we need to support.
As for the model provided by PHP's pthreads extension, this is not a good fit for HHVM, as HHVM is multithreaded, with lots of per-request context being stored in thread-local storage; this means that a single request/script _can not_ have PHP code executing in multiple threads in the same context without substantial changes to HHVM. This would be a huge one-off cost and likely have performance implications that would mean we couldn't merge it anyway; given the limited demand and other unrelated issues that we could work on instead, this would not be a good use of our time.
I guess the most likely form would be something like: run
^ won't fix is just that _we_ won't fix it. We'll be happy to review and consider merging external implementations.