This is a multi-part message in MIME format.
--------------050001070300010900070500
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
I have a process I was thinking of making into a multithreaded daemon
that deals with a MySQL database. The thought is that the daemon would
open the database once, then listen for clients. As clients connected
the daemon would fork off a copy of itself and handle the requests. This
would make the process faster because I wouldn't need to open the
database every time a new client wanted service.
However, I've found that once I fork the database handle (obtained
through DBI) is no longer valid. Reading around a little bit I noticed
people saying to reopen or reconnect to the database in the child. Well
that's the very time consuming thing I was trying to avoid!
Does anybody know how to open a MySQL database such that that database
connection can be used in forked children?
--
Andrew DeFaria <http://defaria.com>
Instead of talking to your plants, if you yelled a them would they still
grow, only to be troubled and insecure?
--------------050001070300010900070500
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body bgcolor="#ffffff" text="#000000">
I have a process I was thinking of making into a multithreaded daemon
that deals with a MySQL database. The thought is that the daemon would
open the database once, then listen for clients. As clients connected
the daemon would fork off a copy of itself and handle the requests.
This would make the process faster because I wouldn't need to open the
database every time a new client wanted service.<br>
<br>
However, I've found that once I fork the database handle (obtained
through DBI) is no longer valid. Reading around a little bit I noticed
people saying to reopen or reconnect to the database in the child. Well
that's the very time consuming thing I was trying to avoid!<br>
<br>
Does anybody know how to open a MySQL database such that that database
connection can be used in forked children?<br>
<div class="moz-signature">-- <br>
Andrew DeFaria<br>
<small><font color="#999999">Instead of talking to your plants, if you
yelled a them would they still grow, only to be troubled and insecure?</font></small>
</div>
</body>
</html>
--------------050001070300010900070500--
