On Tue, Jan 29, 2013 at 4:32 PM, Lester Caine <les...@lsces.co.uk> wrote:

> Ferenc Kovacs wrote:
>
>> On Tue, Jan 29, 2013 at 1:29 PM, Lester Caine <les...@lsces.co.uk> wrote:
>>
>>  Can someone please fill in a little information here. When we start
>>> looking at multiple threads doing for example database lookups in
>>> parallel
>>> with the main page generation. Does that involve 'thread safe' or is it
>>> done in a different way? Scheduling a data lookup on one thread while
>>> building the page the information is to be displayed on seems like a case
>>> for threading in the web server?
>>>
>>>
>>>  we don't have threads in userspace in php, sou you can't do concurrent
>> execution of any function, but there are a couple of extensions providing
>> some way for concurrent/async execution.
>> for the scenario what you described one can use multiple db connections
>> and
>> async queries
>> http://www.php.net/manual/en/**mysqli.poll.php#refsect1-**
>> mysqli.poll-examplesfor<http://www.php.net/manual/en/mysqli.poll.php#refsect1-mysqli.poll-examplesfor>
>> mysql
>> or just a single connection and doing some other work (like rendering the
>> layout) while waiting for the results.
>> if you are interested in a generic solution for concurrent execution you
>> could look into 
>> http://php.net/manual/en/book.**pthreads.php<http://php.net/manual/en/book.pthreads.php>
>>
>
> Thanks ...
> That confirms what I thought. In order to add concurrent operations which
> to my mind are of more use than 'accessors' we do need ZTS mode enabled.
> This is I think a perfectly valid reason for wanting to maintain ZTS in the
> future?
>
>
Yeah, and this was quickly accepted/agreed by Zeev as a reasonable usecase
when it was brought up in the other thread.


-- 
Ferenc Kovács
@Tyr43l - http://tyrael.hu

Reply via email to