From: "Luck, Tony" <tony.luck@intel.com>
To: linux-ia64@vger.kernel.org
Subject: RE: [Linux-ia64] Re: pthread_mutex_lock sometimes fails on Linux
Date: Thu, 28 Jun 2001 00:18:43 +0000 [thread overview]
Message-ID: <marc-linux-ia64-105590693005794@msgid-missing> (raw)
In-Reply-To: <marc-linux-ia64-105590693005788@msgid-missing>
This sounds similar to a problem that I saw a few weeks
ago. In my case threads would spin for an inordinate
amount of time in __pthread_lock() because re-reading of
the __status field was optimised out of the loop (it isn't
declared as volatile). Newer versions of glibc (2.2.2 IIRC)
have some __asm() magic in the loop to force the re-read (the
glibc folks didn't want to make the __status field volatile
because of lots of other pointer casting changes that would
have been needed).
See if a newer glibc helps with your problem too.
-Tony Luck
-----Original Message-----
I slightly misstated the problem. Here is what actually happens:
Four threads have entered a barrier (my own C code). Within the barrier,
they call pthread_mutex_lock and increment a counter while holding the lock.
Three threads are waiting on the counter, whose value is three, to go to
four. The fourth CPU is looping in the kernel in cpu_idle. I don't know
how it got there, but probably it has something to do with calling
pthread_mutex_lock.
next prev parent reply other threads:[~2001-06-28 0:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-06-27 18:20 [Linux-ia64] Re: pthread_mutex_lock sometimes fails on Linux 2.4.5 Bill Nottingham
2001-06-27 18:29 ` [Linux-ia64] Re: pthread_mutex_lock sometimes fails on Linux Robboy, David G
2001-06-27 21:57 ` Robboy, David G
2001-06-28 0:18 ` Luck, Tony [this message]
2001-06-28 7:39 ` [Linux-ia64] Re: pthread_mutex_lock sometimes fails on Linux 2.4.5 Jose Luu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=marc-linux-ia64-105590693005794@msgid-missing \
--to=tony.luck@intel.com \
--cc=linux-ia64@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox