Re: Allowing multiple, simultaneous, non-blocking queries.
| From: | Peter Lind | Date: | Fri, 26 Mar 2010 12:05:19 +0000 |
| Subject: | Re: Allowing multiple, simultaneous, non-blocking queries. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-303504@lists.php.net to get a copy of this message | ||
Hi Richard
At the end of discussion, the best bet for something that "approaches"
a threaded version of multiple queries would be something like:
1. open connection to database
2. issue query using asynchronous call (mysql and postgresql support
this, haven't checked the others)
3. pick up result when ready
To get the threaded-ness, just open a connection per query you want to
run asynchronous and pick it up when you're ready for it - i.e.
iterate over steps 1-2, then do step 3 when things are ready.
Regards
Peter
On 26 March 2010 12:45, Richard Quadling <rquadling@googlemail.com> wrote:
> Hi.
>
> As I understand things, one of the main issues in the "When will PHP
> grow up" thread was the ability to issue multiple queries in parallel
> via some sort of threading mechanism.
>
> Due to the complete overhaul required of the core and extensions to
> support userland threading, the general consensus was a big fat "No!".
>
>
> As I understand things, it is possible, in userland, to use multiple,
> non-blocking sockets for file I/O (something I don't seem to be able
> to achieve on Windows http://bugs.php.net/bug.php?id=47918).
>
> Can this process be "leveraged" to allow for non-blocking queries?
>
> Being able to throw out multiple non-blocking queries would allow for
> the "queries in parallel" issue.
>
> My understanding is that at the base level, all queries are running on
> a socket in some way, so isn't this facility nearly already there in
> some way?
>
>
> Regards,
>
> Richard.
>
> --
> -----
> Richard Quadling
> "Standing on the shoulders of some very clever giants!"
> EE : http://www.experts-exchange.com/M_248814.html
> EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp
> Zend Certified Engineer : W†µŸ¹[Å
> жÞ)‹MÕhttp://zend.com/zce.php?c=ZEND002498&r=213474731
> ZOPA : http://uk.zopa.com/member/RQuadling
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
<hype>
WWW: http://plphp.dk / http://plind.dk
LinkedIn: http://www.linkedin.com/in/plind
Flickr: http://www.flickr.com/photos/fake51
BeWelcome: Fake51
Couchsurfing: Fake51
</hype>