Re: Will PHP ever "grow up" and have threading?

From: Date: Thu, 25 Mar 2010 22:23:04 +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-303484@lists.php.net to get a copy of this message
<?php   $dbconn = pg_connect("dbname=publisher") or die("Could not connect");   if (!pg_connection_busy($dbconn)) {       pg_send_query($dbconn, "select * from authors; select count(*) from authors;");   }   $res1 = pg_get_result($dbconn);   echo "First call to pg_get_result(): $res1\n";   $rows1 = pg_num_rows($res1);   echo "$res1 has $rows1 records\n\n";   $res2 = pg_get_result($dbconn);   echo "Second call to pg_get_result(): $res2\n";   $rows2 = pg_num_rows($res2);   echo "$res2 has $rows2 records\n"; ?> There's the code example from that same link. You may have executed the queries asynchronously, but the process of the results are still serial. Let's face it, all of our processing of queries are not a simple echo. We iterate/loop through the results and display them in the desired format. Having execute the query and the processing of the result in threads/parallel, you get the real performance boost which I've been trying to convey the concept of serial versus parallel.

« previous php.general (#303484) next »