httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Luca Toscano <>
Subject Re: apr_global_mutex_create vs apr_proc_mutex_create
Date Thu, 24 Mar 2016 09:08:44 GMT


2016-03-23 21:49 GMT+01:00 Ali Shah <>:

> Hi Module maintainers,
> I'm writing a simple apache module and I'd like to aggregate some
> statistics.
> I saw an example module that does this (
> using shared memory.
> My question for those on this list following:
> What is the main difference between using mutexes created
> via apr_global_mutex_create and apr_proc_mutex_create in terms of
> performance and safety of the resource that being protected?
> The docs seem to discourage usage of apr_global_mutex_create:
> "There is considerable overhead in using this API if only cross-process or
> cross-thread mutual exclusion is required."
> Is the overhead purely in code setup (since global mutex should be
> initialized in post_config), or is this describing some performance
> penalties as well?

>From what I can see in [1] a global lock uses both apr_proc_mutex_create
and apr_thread_mutex_create, so this is why the documentation suggests the
use of a more specialized one if only cross-process or cross-thread sync is

Not a great explanation I know, somebody else with more experience will
give you a better answer on this list :)



View raw message