Re: Will PHP ever "grow up" and have threading?
| From: | Tommy Pham | Date: | Thu, 25 Mar 2010 22:10:33 +0000 |
| Subject: | Re: Will PHP ever "grow up" and have threading? | ||
| References: | 1 2 3 4 5 6 7 8 9 10 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-303483@lists.php.net to get a copy of this message | ||
On Thu, Mar 25, 2010 at 3:04 PM, Tommy Pham <tommyhp2@gmail.com> wrote:
> On Thu, Mar 25, 2010 at 1:50 PM, Per Jessen <per@computer.org> wrote:
>> Tommy Pham wrote:
>>
>>> I'm presenting the argument for threading. Per is presenting the work
>>> around using asynchronous queries via mysqlnd. I did read that link a
>>> few days ago, "Although the user can send multiple queries at once,
>>> multiple queries cannot be sent over a busy connection. If a query is
>>> sent while the connection is busy, it waits until the last query is
>>> finished and discards all its results." Which sounds like threads ->
>>> multiple connections to not run into that problem.
>>
>> You must have read the wrong page. This is NOT about multiple queries,
>> it's about _asynchronous_ queries.
>>
>>
> That quote is comming directly from that link Peter Lind gave, which
> I read a few days ago. Did you read it?
>
Here's the entire description:
" pg_send_query() sends a query or queries asynchronously to the connection
. Unlike pg_query(), it *can send multiple queries at once to PostgreSQL*and
*get the results one by one using pg_get_result().*
Script execution is not blocked while the queries are executing. Use
pg_connection_busy() to check if the connection is busy (i.e. the query is
executing). Queries may be cancelled using pg_cancel_query().
*Although the user can send multiple queries at once, multiple queries
cannot be sent over a busy connection. If a query is sent while the
connection is busy, it waits until the last query is finished and discards
all its results.*"
Any case, that's only workaround for mysql (mysqlnd) & postgresql. What
about those that uses other RDBMS?