Re: php and multithreading (additional arguments)
| From: | Ferenc Kovacs | Date: | Fri, 02 Apr 2010 07:40:16 +0000 |
| Subject: | Re: php and multithreading (additional arguments) | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-47736@lists.php.net to get a copy of this message | ||
On Fri, Apr 2, 2010 at 9:30 AM, Lester Caine <lester@lsces.co.uk> wrote:
> Jille Timmermans wrote:
>
>> Op 2-4-2010 7:16, Andi Gutmans schreef
>>
>>> I think that if we were ever to implement threading we would be best off
>>> to enable spawning worker threads that have their own context with no
>>> shared data (and therefore no requirement for locking). We could then
>>> have a message passing API between the threads.
>>> Advantages:
>>> - Real multi-threading.
>>> - Simple straightforward approach which doesn't require a comp. sci.
>>> degree to use correctly.
>>> - Very stable implementation.
>>>
>> That sounds like "I want threading; because it sounds cool!". What are
>> the advantages of this above multi-process?
>> The systemcall-overhead for message passing?
>>
>
> Actually Andi's outline forms a nice simple base for something practical.
> It simply builds on the 'background' threading required to run asynchronous
> operations while not creating a unmanageable mess. But I still can't see any
> need to go beyond perhaps asynchronous SQL queries.
>
> Or asynchronous exec, or asynchronous(or at least timout aware)
gethostbyaddr, see:
http://bugs.php.net/bug.php?id=51306
So any task, that require waiting on external resource could be executed in
paralel.
http://hu2.php.net/manual/en/mysqli.reap-async-query.php
its a good thing, that you can async mysql execution with mysqlnd.
Tyrael
> It still requires that all the non-thread safe code is addressed first?
> Even if that simply means disabling extensions that are not safe?
>
>
> And why did nobody mention Aprils Fools yesterday; when the
>> request-for-threading was sent ;)
>>
> Because it was after noon when it was sent ;)
>
>
> --
> Lester Caine - G8HFL
> -----------------------------
> Contact - http://lsces.co.uk/wiki/?page=contact
> L.S.Caine Electronic Services - http://lsces.co.uk
> EnquirySolve - http://enquirysolve.com/
> Model Engineers Digital Workshop - http://medw.co.uk//
> Firebird - http://www.firebirdsql.org/index.php
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>