You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Vinod Mehra <vi...@beasys.com> on 2000/02/28 21:26:34 UTC

Locking critical section in an apache module?

Hi,

How do we achieve serialization of concurrent threads which need access to
global data? How do we lock and unlock critical sections? I am looking
for something equivalent of  NSAPI's crit_int(), crit_enter(), crit_exit()
in Apache.

The documentation says that apache provides a cross-paltform API for
implementing data mutex locking. (ap_acquire_mutex() etc). But I guess at
this 
point of time it has been implemented only for Win32. I am interested to
see if the
implementeation is available of the  UNIX versions of Apache too. If not
when will it be
available? Do we have any alternative at this point of time? 

TIA,
Vinod.

Re: Locking critical section in an apache module?

Posted by Manoj Kasichainula <ma...@io.com>.
On Thu, Mar 02, 2000 at 09:30:25AM -0800, Vinod Mehra wrote:
> I am sorry I didn't mean the Apache Documentation. I was referring to the
> "Writing Apache Modules" book by Stein and MacEachern: Orielly (Pg # 621)
> 
> It says - "The API was introduced with the Win32 port of Apache and will be 
> adapted to future  multithreaded versions of Apache for other platforms.
> While 
> there is no need to implement data access serilization under multiprocess 
> versions of Apache, this API will still work in such environments and is 
> recommended for portability."

Hmmm. That just sounds wrong. AFAIK (I wasn't around at the time),
those calls are only meant for Apache use. Well, the API was never
very clearly defined. *shrug*

Well, since 2.0 uses a completely different set of calls to do this
sort of thing, just ignore that section I guess.

Re: Locking critical section in an apache module?

Posted by Vinod Mehra <vi...@beasys.com>.
At 03:47 PM 3/1/00 -0800, Manoj Kasichainula wrote:
>On Mon, Feb 28, 2000 at 12:26:34PM -0800, Vinod Mehra wrote:
>> The documentation says that apache provides a cross-paltform API for
>> implementing data mutex locking. (ap_acquire_mutex() etc).
>
>Where does it say this? I don't see this in any documentation in the
>Apache 1.3 tree.

I am sorry I didn't mean the Apache Documentation. I was referring to the
"Writing Apache Modules" book by Stein and MacEachern: Orielly (Pg # 621)

It says - "The API was introduced with the Win32 port of Apache and will be 
adapted to future  multithreaded versions of Apache for other platforms.
While 
there is no need to implement data access serilization under multiprocess 
versions of Apache, this API will still work in such environments and is 
recommended for portability."

I am using Apache primarily on Solaris, where it is a multiprocess version.
So I guess I am safe so far.

Thanks,
--Vinod.

Re: Locking critical section in an apache module?

Posted by Manoj Kasichainula <ma...@io.com>.
On Mon, Feb 28, 2000 at 12:26:34PM -0800, Vinod Mehra wrote:
> The documentation says that apache provides a cross-paltform API for
> implementing data mutex locking. (ap_acquire_mutex() etc).

Where does it say this? I don't see this in any documentation in the
Apache 1.3 tree.