apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Bray <Tim.B...@Sun.COM>
Subject Re: Corrected: global_mutex on Solaris 10, does it actually work?
Date Fri, 03 Oct 2008 20:55:47 GMT
On Oct 3, 2008, at 1:16 PM, Ruediger Pluem wrote:

> This maybe because the default locking mechanism on OS X is  
> different from the
> one on Solaris. AFAICR Solaris has fcntl as default mechanism.
> The question is: Why do you create this file beforehand? If a file  
> needs to be
> created apr_global_mutex_create will do this for you.

Good question.  Let me present the problem at a high level.  There's a  
file that is regularly refreshed, and I only want one request handler  
rebuilding it at a time, because otherwise there are lots of horrible  
race conditions.   I don't know whether I'm in worker or prefork  
mode.  So I simply want to serialize update of this file, and I  
thought apr_global_mutex_* was a good way to do this.  Is there a  
better way?  -Tim

View raw message