Re: threads extension
| From: | Andrey Hristov | Date: | Fri, 17 Aug 2007 10:54:44 +0000 |
| Subject: | Re: threads extension | ||
| References: | 1 2 3 4 5 6 7 8 9 10 | Groups: | php.pecl.dev |
| Request: | Send a blank email to pecl-dev+get-4852@lists.php.net to get a copy of this message | ||
Hi,
if I recall right from my experiments with pthreads on C level inside an
extension and memory allocated from Zend, there are problems. Zend, in
debug mode, checks if the memory has been allocated by the same thread,
that's for the e* family of functions. One gets tons of messages and has
to resolve to the libc allocator to be able to share data between threads.
Andrey
Alan Knowles wrote:
> Alexey Zakhlestin wrote:
>> I want to get answers:
>> how well did the code in CVS work?
>>
> from what I remember:
> - thread include almost worked, although was a bit buggy in terms of
> rejoining at exit.
>> were there any technical problems which original authors couldn't
>> solve at that time?
>>
> The whole issue of passing data between threads, and the fact that it
> behaves completely differently to how you would expect threads to work
> (eg. shared resources, etc.). Made the thing rather pointless.. Most of
> this would be next to impossible to solve, given PHP's core design.
>
> You would need to significantly redesign the core engine to do things like:
> - Fixed, flat, simple opcode store, that did not store any context
> information.
> - Scopes that could be accessed in a simple way, and locked etc.
>
> Hope this gives you a flavor of the issues..
> Regards
> Alan
>> after that I will be ready to ask for CVS account and start working. :)
>>
>> On 8/14/07, Antony Dovgal <antony@zend.com> wrote:
>>
>>> On 14.08.2007 22:30, Alexey Zakhlestin wrote:
>>>
>>>> Maybe it wasn't… But there are:
>>>> 1) GUI programms written in PHP (GTK+)
>>>> 2) Net-harvesters written in PHP (a lot of hand-made ones)
>>>> 3) HTTP-server written in PHP (Nanoweb)
>>>>
>>>> etc.
>>>>
>>>> All of these would benefit from threads
>>>>
>>> I don't really understand what you're trying to prove here.
>>> Do _YOU_ need it? If yes, then start working on it.
>>> Or do you want someone else to do it for you?
>>>
>>> --
>>> Wbr,
>>> Antony Dovgal
>>>
>>>
>>
>>
>>
>