httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tair-Shian Chou" <tair-shian.c...@hp.com>
Subject RE: util_ldap [Bug 29217] - Remove references to calloc() and free()
Date Sat, 12 Jun 2004 02:03:28 GMT
Greg wrote:

> then the compiler may optimize this as:
> 
> wrlock
>    test if exists again
>    allocate element
>    insert element
>  >> race is here, prior to filling in element, another thread 
> may  >> read element, and use element that hasn't been filled in yet.
>    fill in element
> unlock
> 

This can not happen because no reader can hold the rdlock while a writer is
holding the wrlock no matter how the compiler optimize it.


Mime
View raw message