I am programming in C, and new to the apache module concept.
I created an apache module that in the child_init connect to a mysql
db. It give me much better results than a CGI that connect every
Now I would like to do another module (or another 10 modules) that all
connecting to the same database, but if I will do a connect in each
module child_init I will create ton of connection to the db. (let's say
apache fork 300 httpd, and I have 10 module => 3000 db connections!)
How can I share the connection between each of my module?
can I create some 'global' that will have some thing like
MYSQL *m_sock=&MySQL; , and all my module will work with m_sock somehow?
if yes where to init it?
If I am asking in the wrong place or you know a page/book I can read
please let me know
Sent via Deja.com http://www.deja.com/
Before you buy.