|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #68511 execution sequence is wrong on the ISAPI
Submitted: 2014-11-27 02:01 UTC Modified: 2014-12-01 02:37 UTC
From: hewei986532 at sina dot com Assigned:
Status: Not a bug Package: pthreads (PECL)
PHP Version: 5.4Git-2014-11-27 (Git) OS: centos
Private report: No CVE-ID: None
 [2014-11-27 02:01 UTC] hewei986532 at sina dot com
The result is wrong when access test script which is Similar to the Singleton.php example file  In the browser to access .Then it's correct on the cli.

Pthread is a great progress for phper。

Test script:

class test {
    public static function hello()
        return true;

if (test::hello()) {
    if (test::hello()) {

class UserThread extends Thread {

    public function run () {
        if (test::hello()) {
            if (test::hello()) {

$thread = new UserThread();

Expected result:
...1 ...2 ...3 ...4 

Actual result:
...3 ...4 ...1 ...2 


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2014-11-30 14:44 UTC]
-Status: Open +Status: Not a bug
 [2014-11-30 14:44 UTC]
Your code doesn't do anything to control the order of output or execution, there are two output buffers being used and it's being left down to the system when to flush them. and when to execute the threads.

Executing user threads inside a web SAPI is not advisable, partly because of the lack of control over output buffers, but mostly because of the inherent problem with scaling threads created by user code as the result of a web request.
 [2014-12-01 02:37 UTC] hewei986532 at sina dot com
Will be correct order of output or execution if doesn't do anything, in future?Have any plans for it? tks
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Thu Dec 02 10:03:34 2021 UTC