From mboxrd@z Thu Jan 1 00:00:00 1970 From: Phil Edwards To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org Subject: Re: libstdc++/4367: Sparc atomicity.h routines can lock up on some OS. Date: Thu, 20 Sep 2001 08:26:00 -0000 Message-id: <20010920152601.3881.qmail@sourceware.cygnus.com> X-SW-Source: 2001-09/msg00420.html List-Id: The following reply was made to PR libstdc++/4367; it has been noted by GNATS. From: Phil Edwards To: eric.norum@usask.ca Cc: gcc-gnats@gcc.gnu.org Subject: Re: libstdc++/4367: Sparc atomicity.h routines can lock up on some OS. Date: Thu, 20 Sep 2001 11:23:25 -0400 On Thu, Sep 20, 2001 at 02:50:01PM -0000, eric.norum@usask.ca wrote: > >Description: > The sparc version of the routines in atomicity.h can lock up > on operating systems which provide strict priority-based > scheduling (e.g. vxWorks, pSOS+, eCOS, RTEMS). Here's the > scenario: > 1) Low priority task enters __exchange_and_add and sets > the lock. > 2) While low-priority task is still active in > __exchange_and_add a higher-priority task preempts. > 3) The higher-priority task enters __exchange_and_add and > enters an infinite loop trying to set the lock. A classic case of priority inversion. Wow. I never imagined I'd be involved in one of those. :-) One of the various Mars rover-type vehicles got locked up by priority inversion, I recall. -- Would I had phrases that are not known, utterances that are strange, in new language that has not been used, free from repetition, not an utterance which has grown stale, which men of old have spoken. - anonymous Egyptian scribe, c.1700 BC