[redland-dev] Threads

Dave Beckett dave at dajobe.org
Sat Sep 5 02:12:02 CEST 2009


Brendan Hahn wrote:
> No response to my message of last week, so let me try again.  It's pretty simple: librdf_cache_set_common locks the world mutex, calls librdf_cache_cleanup, which calls librdf_cache_delete, which locks the world mutex.  pthreads mutexes are non-recursive by default, thus deadlock.  So I can fix this by setting PTHREAD_MUTEX_RECURSIVE at init time, but how was this supposed to work?
> 
> Further, there's this from librdf_free_cache:
>      LIBRDF_FREE(librdf_cache, cache);
> 
>    #ifdef WITH_THREADS
>      pthread_mutex_unlock(cache->world->mutex);
>    #endif
> 
> So I'm just not feeling confident about Redland's thread support in general.  Can anyone allay my concerns?

In general it should be OK, but the cache module is newer and the above
looks suspicious to me.  Since threading is rather hard to get right, it
needs somebody who knows it to identify and fix problems.

Dave



More information about the redland-dev mailing list