Re: pthread & thread support : issues?

From: Date: Wed, 23 Jan 2002 00:44:26 +0000
Subject: Re: pthread & thread support : issues?
References: 1 2  Groups: php.dev 
Request: Send a blank email to php-dev+get-77850@lists.php.net to get a copy of this message
Jason Greene wrote:
On Mon, 2002-01-21 at 20:47, Alan Knowles wrote:
After spending yesterday looking at the pcntl library, I did at one point attempt to get create_thread going, It didnt get very far, (it segfaulted on emalloc - perhaps because thread_init had not been called) but I did start wondering about the feasibilty.. Has anybody ever attempted it?
This is not currently possible because PHP/Zend is not reenterant. Thread safty is done by emulating processes via TSRM. The only way to add thread support to php would be to open individual executer/interpreters and then use some kind of mutexed shared variable system. This would require ALOT of engine work. Ask Zeev, and Andi if you would like : ) -Jason Yeah, I think that what I realized after chatting to stirling, - It's not impossible, just difficult :) - or a real mans challenge :)
he was suggesting a scheduler, - I would interpret that to mean wrapping execute() somehow. - but as you hint, it's not light work :) It may be easier to implement a few choice commands (like popen) under internal threading, rather than expose it to user space, - eg. similar to your callback stuff on pcntl I was still testing pcntl as a module (this may be a problem,) but Unless I put the child fork to sleep forever, rather than kill SIGTERM the child, I tended to get segfaults..(which appeared to have useless backtraces). - If I get more time, I'll see if I can isolate it, - but the sample test-pcntl.php will segfault on the machine here. (at the very end) regards alan
The basic task of creating a set of php functions which wrapped the thread library - based perhaps on some of the code in python's thread library didnt seem particulary complex, however can anyone think of any issues that would occur? Would it only work as a built in module rather than a loadable module? anyway, I couldnt find any threads 'on threads:)' on php-dev discussing it - has anybody got any comments? regards alan -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net For additional commands, e-mail: php-dev-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net


« previous php.dev (#77850) next »