linux - Enable Thread Safety for Php Version 5.6.2 -


i have below php version installed in linux server.

enter image description here

now want run below program -

<?php class asyncoperation extends thread {  public function __construct($arg) {     $this->arg = $arg; }  public function run() {     if ($this->arg) {         $sleep = mt_rand(1, 10);         printf('%s: %s  -start -sleeps %d' . "\n", date("g:i:sa"), $this->arg, $sleep);         sleep($sleep);         printf('%s: %s  -finish' . "\n", date("g:i:sa"), $this->arg);     } } }  // create array $stack = array();  //iniciate miltiple thread foreach ( range("a", "d") $i ) { $stack[] = new asyncoperation($i); }  // start threads foreach ( $stack $t ) { $t->start(); } ?> 

i need enable thread safety php installation. can inform me how can ?

ok, i asked package maintainer:

if want use threaded version of php, on own. while might work fine in specific environment, it's not thread-safe in possible scenarios (including loading external modules) , it's not wise provide "thread-safe" packages general use.

so, no way out :-/


Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -