Thomas.Seiler@xxxxxxxxxxxx wrote:
Hi Jochem,
if you are using apache then virtual() might offer a solution? (just
guessing)
Cool, I didn't know of that one. But it seems that is just calls back
into apache, i.e. it doesn't generate a second independent thread. This
would have been too good to be true :)
php engine is thread safe (in principal?) but chances are very high you
run extensions that are not. in short running php in a [true] threaded server
is only for those who enjoy a good root canal.
We have since found a solution for postgres. It supports asynchronous
queries and also killing of them:
nice feature.
//snip ----------------------------------------------------------
// Setup query cancel handler
ignore_user_abort(false);
register_shutdown_function(cancel_query);
...
// Handler
function cancel_query() {
pg_cancel_query($dblink);
}
...
// Actual Query
pg_send_query($dblink, $query); // this is non-blocking
// This seems to be needed so that php recognizes closed connections
while(pg_connection_busy($dblink)){
usleep(500000); echo ' '; flush();
}
// get the result from async query execution.
$result = pg_get_result($dblink);
//snip----------------------------------------------------------------
We are now looking for something similar for mysql.
Cheers,
Thomas
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php