Re: Help with apr mutex

2011-03-01 Thread Ben Noordhuis
On Tue, Mar 1, 2011 at 17:32, Joshua Marantz wrote: > Is there any design doc or examples on how these can be used to, say, > construct > a server-wide cache that can be accessed from any of the child processes in > (say) prefork mode? I don't know of any design documents or tutorials but as to

Re: Help with apr mutex

2011-03-01 Thread Simone Caruso
On 28/02/2011 22:48, Ben Noordhuis wrote: On Mon, Feb 28, 2011 at 18:26, Simone Caruso wrote: I wrote a simple cache inside my module with apr_shm and apr_rmm Simone, have a look at ap_socache.h and ap_slotmem.h, they're two simple cache facilities that were added in 2.3.0. Might save you som

Re: Help with apr mutex

2011-02-28 Thread Ben Noordhuis
On Mon, Feb 28, 2011 at 18:26, Simone Caruso wrote: > I wrote a simple cache inside my module with apr_shm and apr_rmm Simone, have a look at ap_socache.h and ap_slotmem.h, they're two simple cache facilities that were added in 2.3.0. Might save you some work. :)

Re: Help with apr mutex

2011-02-28 Thread Simone Caruso
On 28/02/2011 18:53, thomas bonfort wrote: a few things to try: * you should use APR_STATUS_IS_EBUSY(s) instead of ... == APR_EBUSY * after creating the mutex, you might have to set permissions on it: #ifdef AP_NEED_SET_MUTEX_PERMS rc = unixd_set_global_mutex_perms(mutex); if(rc != APR_S

Re: Help with apr mutex

2011-02-28 Thread Simone Caruso
On 28/02/2011 18:35, Jim Jagielski wrote: Why not check the return status of the lock and unlock calls?? Ehm... i'm an idiot... i create the lock in this way: module_post_config(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s) { lock = ap_server_root_relative(p, "mym

Re: Help with apr mutex

2011-02-28 Thread thomas bonfort
a few things to try: * you should use APR_STATUS_IS_EBUSY(s) instead of ... == APR_EBUSY * after creating the mutex, you might have to set permissions on it: #ifdef AP_NEED_SET_MUTEX_PERMS rc = unixd_set_global_mutex_perms(mutex); if(rc != APR_SUCCESS) { ap_log_error(APLOG_MARK, APLOG_

Re: Help with apr mutex

2011-02-28 Thread Jim Jagielski
Why not check the return status of the lock and unlock calls?? On Feb 28, 2011, at 12:26 PM, Simone Caruso wrote: > Hi all, > > I wrote a simple cache inside my module with apr_shm and apr_rmm, but I have > problems with apr mutex... > > I have this peace of code: > > static apr_global_mutex_