Re: AW: [PEAR-DEV] Package Proposal: PHP::Thread
| From: | Alan Knowles | Date: | Tue, 21 Oct 2003 00:28:29 +0000 |
| Subject: | Re: AW: [PEAR-DEV] Package Proposal: PHP::Thread | ||
| References: | 1 2 3 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-22854@lists.php.net to get a copy of this message | ||
What if he implements shared memory? (SHMOP for cross-platform... though I think they user should be able to choose SYSVSEM if on *nix... these things of course need to be compiled into PHP but thats not a problem as PCNTL itself needs to be compiled in also.
Actually the best I came up with when I did it was to overload an object, and store the variables in a database (or dbm file).. - that way it's pretty easy to code/lock etc.. - shmop was just a pigs ear to get working reliably..
It's a workable solution, but it's all just a workaround for the fact that we cant get 'real threads' which offer
- shared php binary memory space (forking will double you memory usage)
- shared application memory space (this is a fundimental problem with the ZE engine, that you cant share opcodes)
- shared data memory space (havent got a hope in hell for this natively... - although it's probably possible to do a superglobal or overloading as above, to accessed shared variables...)
What the package is, is a thread based api implemented using forking.. - ... Fork_ThreadAPI may be a more suitable name...
Regards
Alan
Just a thought.... - Davey