3 ms·
I thought the reason PHP doesn't have a GIL, is that out of the box, it doesn't even have threads at all? Is my PHP knowledge out of date? Is the this the curr
by antod 5y ago
I thought the reason PHP doesn't have a GIL, is that out of the box, it doesn't even have threads at all?
Is my PHP knowledge out of date? Is the this the current state the art: ?
https://www.php.net/manual/en/parallel.setup.php https://www.php.net/manual/en/parallel.setup.php
- tored 5y agoPHP doesn’t ship with an API for creating threads, but PHP can be executed in threads depending on setup. And it does that without using a GIL, instead it internally uses something called Thread-Safe Resource Manager https://github.com/php/php-src/tree/master/TSRM https://github.com/php/php-src/tree/master/TSRM I have written about this recently https://news.ycombinator.com/item?id=28692014 https://news.ycombinator.com/item?id=28692014
- lioeters 5y agoI don't know much about it, but I've heard here and there about Swoole, a "PHP extension for Async IO, Coroutines and Fibers". > Swoole is a complete PHP async solution that has built-in support for async programming via fibers/coroutines, a range of multi-threaded I/O modules (HTTP Server, WebSockets, TaskWorkers, Process Pools) and support for popular PHP clients like PDO for MySQL, Redis and CURL. https://www.swoole.co.uk/ https://www.swoole.co.uk/