RE: Multiple Threads?
| From: | Matthew Walker | Date: | Sun, 14 Apr 2002 23:49:33 +0000 |
| Subject: | RE: Multiple Threads? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-92946@lists.php.net to get a copy of this message | ||
Won't work for web connections, because it waits for each connection to
complete before running the next one.
Matthew Walker
Senior Software Engineer
ePliant Marketing
-----Original Message-----
From: Richard Creech [mailto:richardc@dreamriver.com]
Sent: Sunday, April 14, 2002 1:46 PM
To: php-general@lists.php.net
Cc: Matthew Walker
Subject: Re: Multiple Threads?
Hello All,
IF you are using mySQL database then the php manual indicates you can
run multiple connections. Presumably you could execute several web
queries at the same time, each with its own connection. I haven't tried
such, but the manual suggests it is possible:
http://www.php.net/manual/en/function.mysql-connect.php
"If a second call is made to mysql_connect() with the same arguments, no
new link will be established, but instead, the link identifier of the
already opened link will be returned. The new_link parameter modifies
this behavior and makes mysql_connect() always open a new link, even if
mysql_connect() was called before with the same parameters.
Note: The new_link parameter became available in PHP 4.2.0
"
Kind Regards,
Richard Creech
richardc@dreamriver.com
250.744.3350 Pacific Time Canada
Dreamriver Software Powers the Net
http://www.dreamriver.com
"Matthew Walker" <mwalker@mountaintopherbs.com> wrote:
I don’t remember the name of the module offhand, but once upon a time, I
used a perl module that would fork multiple threads so that you could
execute several web queries at the same time. This saved a lot of time,
if, for instance, you had to get information from UPS, FedEx, and the
USPS about shipping rates to display on a page. If you had to query them
one at a time, the delay would be unacceptable. However, with that perl
module, you could query them all at the same time, making it much
faster.
Does anyone know if such a thing exists for PHP?
Matthew Walker
Senior Software Engineer
ePliant Marketing
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.345 / Virus Database: 193 - Release Date: 4/9/2002