httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Vergoz ...@binarysec.com>
Subject Re: Shared memory on Win (Was: ldap crash on exit)
Date Wed, 16 Nov 2005 08:48:42 GMT
hi,

you can't specify a base address on Apache because portability and  
compatibilty with different other softs. And that way will not fix  
this problem.
you can load and manage a shared map in Apache but you can't expand  
it. That problem is due in part to the Apache MPM prefork/worker engine.

PostGreSQL doesn't have the same problem because it doesn't have to  
interrupt some CGI or exec programs . For example actualy PHP can't  
work on threaded environnement because its global variables and note  
that its parser isn't atomic. these problems are also present with  
Perl, Tomcat etc...

i had work for a long time about this subject and the only way i have  
found it's to build a new SHM inter-process protocol associated with  
a new MPM engine.

it's a design problem and Apache isn't the person in charge. They can  
done what i say but it's little nightmare.

also note that mod_auth_ldap is experimental in Apache.

- michael

Le 16 nov. 05 à 12:09, Vadim Chekan a écrit :

> Some time ago I reported a reason why Ldap module can not work on
> Windows and crashes when caching is enabled. It is because shared
> memory that is obtained by processes has different base address for
> each process.
>
> I thought to replace pointers with offsets everywhere but it became
> really ugly. To get any pointer you have to make a function and call
> it.
> This made me thinking how projects like PostgreSQL which recently has
> been ported to Win32 and are very shared memory oriented did it. As a
> result I found that there is a function in Win API that allows to map
> shared memory with desired base address!
>
> Currently APR uses Win32 API MapViewOfFile(). But there is a
> modification of this function, MapViewOfFileEx()
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ 
> fileio/fs/mapviewoffileex.asp
> which has an additional argument
> ================================
> lpBaseAddress
>     [in] A pointer to the memory address in the calling process
> address space where mapping begins.
> ...
>     If lpBaseAddress is NULL, the operating system chooses the mapping
> address. In this scenario, the function is equivalent to the
> MapViewOfFile function.
> ================================
>
> So, I'm quite sure APR needs to use this function to map shared memory
> to the same address in all processes and make win application similar
> to unix.
>
> Vadim Chekan.



Mime
View raw message