Another mail.. -Madhu
>-----Original Message----- >From: CHOU,TAIR-SHIAN (HP-Cupertino,ex1) >[mailto:[EMAIL PROTECTED] >Sent: Friday, June 11, 2004 7:05 PM >To: Mathihalli, Madhusudan >Subject: FW: util_ldap [Bug 29217] - Remove references to >calloc() and free() > > > >-----Original Message----- >From: Tair-Shian Chou [mailto:[EMAIL PROTECTED] >Sent: Friday, June 11, 2004 7:03 PM >To: '[EMAIL PROTECTED]' >Subject: RE: util_ldap [Bug 29217] - Remove references to >calloc() and free() > > >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. >
