On Tue, Nov 29, 2011 at 08:09:31AM -0800, Richard Henderson wrote:
> Tight loops like this should use the weak compare-exchange so that we don't 
> get two nested loops without need.

Done.

> I do think we need more commentary here so that next month I can still follow 
> it.

Added this in gomp_sem_post

  /* Clear SEM_WAIT here so that if there are no more waiting threads
     we transition back to the uncontended state that does not make
     futex syscalls.  If there are waiting threads then when one is
     awoken it will set SEM_WAIT again, so other waiting threads are
     woken on a future gomp_sem_post.  Furthermore, the awoken thread
     will wake other threads in case gomp_sem_post was called again
     before it had time to set SEM_WAIT.  */

and committed revision 181831 without likely_compare_exchange as
discussed.

-- 
Alan Modra
Australia Development Lab, IBM

Reply via email to