This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Memory fencing problem in pthread cancellation


On 01/14/2013 03:51 PM, Carlos O'Donell wrote:
On 01/14/2013 03:50 PM, Roland McGrath wrote:
I'd like to see comments clarifying what the memory clobber is actually
accomplishing and why it's necessary.  The other introductions of barriers
that have no comments need comments.


Jeff,


I'd suggest something like this:

   atomic_write_barrier ();
+  /* At the point at which any thread writes the handle
+     to libgcc_s_handle, the initialization is complete.
+     The writing of libgcc_s_handle is atomic. All other
+     threads reading libgcc_s_handle do so atomically. Any
+     thread that does not execute this function must issue
+     a read barrier to ensure that all of the above has
+     actually completed and that the values of the
+     function pointers are correct.   */
   libgcc_s_handle = handle;
Looks good to me. Next iteration will include this change.

jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]