You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Pierpaolo Fumagalli <ia...@iname.com> on 1998/06/27 11:22:24 UTC

Win32 Shared Memory

From: Rodent of Unusual Size <Ke...@Golux.Com>

> If you feel you've got a contribution to make, go right ahead and

> join the new-httpd list.  But you must already be on it if you're

> responding to my STATUS messages.. so just go ahead and propose

> what you want to do.


Hi all...
    Sorry for "popping in" but anyway Ken told me to do that way. We were
discussing about the new features of Apache 2.0 (in details about a library
of routines to allow access to memory shared between processes, for things
like per-module caches - see Subj: [STATUS] (apache-2.0) Wed Jun 24 23:45:25
EDT 1998).

Currently developing mod_jserv what I find really difficult is to face the
two different environments we have under Unix (I mean - my Linux box) and
Windows: shared memory. In Linux I have an interprocess shared memory
segment where all my data resides and that is kept for all processes, while
under Win32 I find a protected memory for each process (while threads in the
same process have all the same memory).

This fact is creating some problems to me, since I'd like to have
"APACHE-Wide" not "process-wide" memory for allocating data I need (JServ
needs to spawn a Java Virtual Machine and to have some configuration data,
one only for the whole APACHE, not one for each process, and for getting
this I had to pass thru some "tricks" like raising and waiting for some
events, duplicating memory & so on...)

To fix this I worked a little bit under Win32 using inter-processes
interaction and I found a way to build up a shared memory segment and this
is really helping me, but anyway I have to place in my code some big #ifdef
WIN32 #else and of course I don't like it.

What I wanted was to create a Shared Memory Segment for Apache in the same
way as Unix (again Linux) does for its processes to achieve two targets: 1)
a better code in my module (in italy we say - first think to you then to
others - ;-) and 2) the same operation for both Win32 and Unix.

This shouldn't be hard to do, thru some CreateFileMapping() and relative
calls, but it could be a great improvement to the different behaviours we
have under Win32 and Unix.

I took a look at the startup code when writing PR#2467 (Thanks Ben Laurie
for committing the CVS changes!) and I think I could be able to make that
patch, but if someone from your Win32 team wants to do it, I will really
appreciate it. What should I do? Should I try (and I mean TRY) to fix it?

Thanks and SORRY FOR THE LONG-LONG EMail
    Pier