apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From E Holyat <ehol...@yahoo.com>
Subject apr_pools and thread safety
Date Tue, 28 Jun 2005 16:41:36 GMT
I assumed that pools were thread safe.
Is apr_palloc intended to be thread safe within a pool object?
Does the entire function need to be mutexed? Looks like it should be
Could just the pool->active be locked until incremented? Maybe
Should it have a read write lock?
apr_palloc isn't thread safe, and allocator_alloc has some holes:   The entire function should
be locked.

    if (index <= allocator->max_index) {        can be incremented while being accessed
    /* If we found nothing, seek the sink (at index 0), if
     * it is not empty.
    else if (allocator->free[0]) {               2 threads can enter.

Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
View raw message