Re:Python stands to lose its GIL, and gain a lot of speed
by cm2187 on Sunday October 17, 2021 @03:34PM
(#28899098)
Popularity has probably as much to do, if not more to do, with ease of access (or lack of alternative) than good design of the language. Php is equally if not more popular than python.
[ Parent
| on HN ]
Re:Python stands to lose its GIL, and gain a lot of speed
by aeturnum on Sunday October 17, 2021 @06:00PM
(#28900192)
I'm not a PHP expert, but I did not know it was also used in data science, game programming, embedded programming and machine learning as Python is. Of course they are both used for web services.
Re:Python stands to lose its GIL, and gain a lot of speed
by tored on Sunday October 17, 2021 @07:52PM
(#28900795)
Funny thing is that PHP does not have GIL, thus it would perform better on each of those things that you list.
Re:Python stands to lose its GIL, and gain a lot of speed
by antod on Sunday October 17, 2021 @08:50PM
(#28901149)
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
Re:Python stands to lose its GIL, and gain a lot of speed
by tored on Sunday October 17, 2021 @11:59PM
(#28902103)
PHP 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
I have written about this recently
Re:Python stands to lose its GIL, and gain a lot of speed
by lioeters on Monday October 18, 2021 @05:31AM
(#28903687)
I 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.