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?
--
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
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk
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
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
--
Ferenc Kovács
@Tyr43l - http://tyrael.hu
Ferenc Kovacs 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
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
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?
--
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
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk
Ferenc Kovacs 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-examplesforhttp://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.phphttp://php.net/manual/en/book.pthreads.phpThanks ...
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