logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Building & Member Downloads View previous topic :: View next topic
Reply to topic   Topic: 2 Apache modules using the same static and global variables
Author
Vineeta



Joined: 13 Nov 2007
Posts: 2

PostPosted: Tue 13 Nov '07 8:48    Post subject: 2 Apache modules using the same static and global variables Reply with quote

I have 2 apache modules which use the same generic code (global and static variables) while loading or initializing. So as a result, the data is being overwritten by the latest module that initializes. Since the modules are 2 threads in the same apache process, they will be using the same address space (heap). Are there any Apache configurations for avoiding global data clash by these threads.
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Tue 13 Nov '07 18:32    Post subject: Reply with quote

Did you write that modules on your own? Which are they?
Back to top
Vineeta



Joined: 13 Nov 2007
Posts: 2

PostPosted: Wed 14 Nov '07 5:33    Post subject: Reply with quote

Those modules have been written by some of my colleagues who have now left the organization.
As soon as we start the apache process, the modules have to initialize some global and static variables. Since those two modules are threads in the same Apache process, the same variables are getting initialized twice. Both the modules have different values of initialization, and if one module initializes the variables first, the second module overwrites the same variables.
What if we have 2 different apache processes for the 2 modules? (1 process loads the 1st module and the other process loads the 2nd module). In such case will there be any overload?
Back to top


Reply to topic   Topic: 2 Apache modules using the same static and global variables View previous topic :: View next topic
Post new topic   Forum Index -> Building & Member Downloads