Implementing parallelism without using pcntl_fork
?
#3665
morrisonlevi
started this conversation in
Ideas
Replies: 1 comment
-
@morrisonlevi I haven't looked into the potential implementation for PHPCS, but from working with
A good implementation can, of course, work round these issues, but it is definitely more complex and the performance overhead of those work-arounds may not be worth making the change. As for using something like Symfony's |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Currently, the parallelism for phpcs is achieved via
pcntl_fork
. Fork without exec has a variety of problems, and I hit some of those recently in an extension I maintain. I need to fix it; it's not phpcs's problem. However, in the interest of moving the community forward instead of just fixing my problem, I thought I'd open this discussion.The main way to fix these issues on Linux today is to exec after forking. This is what
proc_open
does. In the future there may be better ways to avoid forking like usingio_uring_spawn
, but we don't have that today.Has anyone experimented with using
proc_open
instead ofpcntl_fork
for parallelism inphpcs
in the past? If not, does anyone more familiar with the codebase than I am have any insight for what might make it difficult? Theoretically this move would help out with portability too, so it may be valuable aside from the issue withpcntl_fork
.There's also a possibility to use something like Symfony's
PhpProcess
to make it easier too. Any opposition to doing something like that?Beta Was this translation helpful? Give feedback.
All reactions