DEV Community

Discussion on: Processing One Billion Rows in PHP!

Collapse
 
chx_90 profile image
chx

I wonder, would it be possible to use fibers here (which is core since 8.1) instead of parallel?

Collapse
 
realflowcontrol profile image
Florian Engelhardt

Fibers are cooperatively scheduled, meaning they run in your current thread and you have to schedule them manually. We can't use fibers to do parallel processing like it is possible with threads.
There is a nice writeup about it at php.watch/versions/8.1/fibers