Stas Bekman writes:
 > On Tue, 5 Sep 2000, Michael Peppler wrote:
 > 
 > > The idea is to create a pool of connections during the main
 > > apache/modperl startup. Because these connections end up in the code
 > > segment for the child processes they are completely shareable. You
 > > populate a hash in a BEGIN block with x connections, and then provide
 > > some calls to grab the first available one (I use IPC::Semaphore to
 > > coordinate access to each connection).
 > 
 > There is no such a thing as a code segment in Perl. Everything is handled
 > as data, so unless you write your code in C and glue it to Perl, you
 > cannot ensure that some read/write variable wouldn't land on the same page
 > with the data that stores the connections.

I guess it's in the shared data segment then. In any case the
connections and the datastructures that go with them are visible from
all the child httpd processes.

 > > The advantage of this solution is that connections don't go down when
 > > the apache child dies (for example because the MAX_REQUEST per child
 > > has been reached).
 > 
 > If there would be a way for a chile to know its processor slot as seen by
 > Apache::Status, there will be no need for any semaphoring technique --
 > each process will access the connection by asking for its slot
 > number. This will work because when the child being reaped off a new
 > process replacing it is running in the same slot. Looks a much faster way
 > to me if you get hold of the slot number.

I'll look into that - thanks.

Michael
-- 
Michael Peppler         -||-  Data Migrations Inc.
[EMAIL PROTECTED]    -||-  http://www.mbay.net/~mpeppler
Int. Sybase User Group  -||-  http://www.isug.com
Sybase on Linux mailing list: [EMAIL PROTECTED]

Reply via email to