httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrej van der Zee <andrejvander...@gmail.com>
Subject Re: custom background thread and module sharing a data structure
Date Fri, 13 Mar 2009 23:40:22 GMT
Hi,



> My point is that within a single process, multiple threads can service
> requests that can end up firing your module code. If you only do process
> locking you can still have more than 1 thread executing your module code at
> the same time.
>
> Just a process level lock will *not* guarantee that only a single thread is
> executing your code within the process holding the lock. A inter thread lock
> is needed to synchronize multiple threads within that processes from
> stomping on a shared resource.
>
>
Yeah you are right, two thread in the same process in the mpm worker model
still execute the same code to access the shared inter-process resource. So
I guess I need to add the thread-based mutexes within a APR_HAS_THREADS
define, like in some other modules I have seen. Thanks for clearing this up!

Cheers,
Andrej

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message