krakjoe / parallel

A succinct parallel concurrency API for PHP8
Other
1.49k stars 96 forks source link

running "new \parallel\Runtime()" hangs indefinitely ? #141

Closed nargyriou closed 3 years ago

nargyriou commented 4 years ago

I have PHP 7.3.5 with thread support, and VC15

If I try to run this:

$runtime = new \parallel\Runtime();
echo "Hello";
$runtime->kill();
die();

I get no output, the page stalls and the browser gives me "The connection was reinitialized"

The only line I need for the page to stall is $runtime = new \parallel\Runtime();

I only just installed the extension

Surely I must have missed something

Here's a snippet from my phpinfo();

System Windows NT DESKTOP-3DG2O29 10.0 build 18362 (Windows 10) AMD64
Build Date May 1 2019 13:10:59
Compiler MSVC15 (Visual C++ 2017)
Architecture x64
Configure Command cscript /nologo configure.js "--enable-snapshot-build" "--enable-debug-pack" "--with-pdo-oci=c:\php-snap-build\deps_aux\oracle\x64\instantclient_12_1\sdk,shared" "--with-oci8-12c=c:\php-snap-build\deps_aux\oracle\x64\instantclient_12_1\sdk,shared" "--enable-object-out-dir=../obj/" "--enable-com-dotnet=shared" "--without-analyzer" "--with-pgo"
Server API Apache 2.0 Handler
Virtual Directory Support enabled
Configuration File (php.ini) Path C:\WINDOWS
Loaded Configuration File C:\wamp64\bin\apache\apache2.4.39\bin\php.ini
Scan this dir for additional .ini files (none)
Additional .ini files parsed (none)
PHP API 20180731
PHP Extension 20180731
Zend Extension 320180731
Zend Extension Build API320180731,TS,VC15
PHP Extension Build API20180731,TS,VC15
Debug Build no
Thread Safety enabled
Thread API Windows Threads
Zend Signal Handling disabled
Zend Memory Manager enabled
Zend Multibyte Support provided by mbstring
IPv6 Support enabled
DTrace Support disabled
Registered PHP Streams php, file, glob, data, http, ftp, zip, compress.zlib, compress.bzip2, https, ftps, phar
Registered Stream Socket Transports tcp, udp, ssl, tls, tlsv1.0, tlsv1.1, tlsv1.2
Registered Stream Filters convert.iconv., string.rot13, string.toupper, string.tolower, string.strip_tags, convert., consumed, dechunk, zlib., bzip2.

And parallel is indeed in the extensions

parallel support enabled
parallel version 1.1.3 php_parallel-1.1.3-7.3-ts-vc15-x64
bavohe3648 commented 4 years ago

I have the same issue. When creating multiple runtime instances with new \parallel\Runtime(); some instances fail to create and the process hangs indefinitely. Using: PHP 7.4.6 (cli)( ZTS Visual C++ 2017 x64 ) parallel version = 1.1.3

krakjoe commented 3 years ago

If the issue persists under 8.0+ please open a new issue.

Note, I don't know why you would try to run:

$runtime = new \parallel\Runtime();
echo "Hello";
$runtime->kill();
die();