I've already partly answered your question in
Re: (ar0n: pnotes) Re: Sharing data structures among http processes?, to clarify another response.
To directly answer your question, I should explain that
you are encountering a feature of Unix called copy on
Apache 1.x on Unix uses a pre-forking model, whereby a
parent httpd process forks off a number of child httpds
each of which handle one request at a time. When a Unix
process forks, another identical process is created. To
save memory, this identical process shares all of its
data with the parent process. However, as soon as either
process changes a certain area of memory, separate copies
of that memory are created for each process. Hence the
name copy on write. This is what you are observing as data
Aside from memory requirements, the technique you are using
suffers from another problem. Imagine you have 3 httpd
processes (called A, B and C) serving requests, each with
a name and phone number data structure. Initially, each
process holds the following information:
If process A receives a request to change Bergen's number to
398, the data structures in processes B and C will not be
affected. So, if a request to retrieve Bergen's number
reaches process C, it will report that Bergen's number is
still 392. Thus, it is important to share data sets between
processes if the data may be written to.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||