All of lore.kernel.org
 help / color / mirror / Atom feed
From: John David Anglin <dave@hiauly1.hia.nrc.ca>
To: Carlos O'Donell <carlos@systemhalted.org>
Cc: linux-parisc@vger.kernel.org
Subject: Re: futex wait failure
Date: Wed, 23 Dec 2009 11:15:05 -0500	[thread overview]
Message-ID: <20091223161504.GA13299@hiauly1.hia.nrc.ca> (raw)
In-Reply-To: <119aab440912230701g6656be6fsdaf5383d2ff02363@mail.gmail.com>

On Wed, 23 Dec 2009, Carlos O'Donell wrote:

> On Tue, Dec 22, 2009 at 5:05 PM, John David Anglin
> <dave@hiauly1.hia.nrc.ca> wrote:
> >> I think we need to step back from the edge and ask ourselves what
> >> Tcl_WaitForEvent() is trying to do with the locks.
> >>
> >> Do you know?
> >
> > In unix/tclUnixNotify.c:
> >
> > #ifdef TCL_THREADS
> > =A0 =A0/*
> > =A0 =A0 * Place this thread on the list of interested threads, sign=
al the
> > =A0 =A0 * notifier thread, and wait for a response or a timeout.
> > =A0 =A0 */
>=20
> There will never be a timeout if you call pthread_mutex_lock as the
> underlying operation. So this comment is a bit odd?

The wait is done by Tcl_ConditionWait.  It uses  pthread_cond_wait
if timePtr is NULL, otherwise it uses
pthread_cond_timedwait(pcondPtr, pmutexPtr, &ptime).  Do these work
holding a lock?  Any chance that these try to take a lock?

It sems like bad coding to do a wait holding a lock.  In any case,
I don't think this is the problem.

As you noted, the lock is held by the other thread.  The return pc is
beyond Tcl_WaitForEvent.  The only users of the notifierMutex mutex
are in tclUnixNotfy.c.  The only interesting thing done holding the
notifierMutex mutex in code after Tcl_WaitForEvent is to call
Tcl_ConditionNotify.  It calls pthread_cond_broadcast if the condition
pointer isn't NULL.

Could this deadlock?  It's hard to see how it could since the mutex
doesn't seem to be involved.

Dave
--=20
J. David Anglin                                  dave.anglin@nrc-cnrc.g=
c.ca
National Research Council of Canada              (613) 990-0752 (FAX: 9=
52-6602)
--
To unsubscribe from this list: send the line "unsubscribe linux-parisc"=
 in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2009-12-23 16:15 UTC|newest]

Thread overview: 79+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20091222164810.DBF3B516F@hiauly1.hia.nrc.ca>
2009-12-22 20:30 ` futex wait failure Carlos O'Donell
2009-12-22 22:05   ` John David Anglin
2009-12-23 15:01     ` Carlos O'Donell
2009-12-23 16:15       ` John David Anglin [this message]
2009-12-23 16:48         ` John David Anglin
2009-12-23 20:39           ` John David Anglin
2009-12-23 20:45             ` Carlos O'Donell
2009-12-23 20:46               ` Carlos O'Donell
2009-12-23 21:08               ` John David Anglin
2009-12-23 21:48                 ` Carlos O'Donell
2009-12-23 20:36         ` Carlos O'Donell
2009-12-23 20:57           ` John David Anglin
     [not found]   ` <20091222212950.8E5F74EA9@hiauly1.hia.nrc.ca>
2009-12-23 14:56     ` Carlos O'Donell
     [not found] <no.id>
2009-12-23 22:18 ` John David Anglin
2009-12-24  2:22   ` Carlos O'Donell
2009-12-28 18:59     ` John David Anglin
2009-12-29 13:47       ` Helge Deller
2009-12-29 15:00         ` John David Anglin
2009-12-30 10:49           ` Randolph Chung
2009-12-31 18:14         ` Carlos O'Donell
2009-12-31 19:11           ` Helge Deller
2010-01-01  3:49             ` John David Anglin
2010-01-01  5:02               ` John David Anglin
2010-01-04 16:27               ` Helge Deller
2010-01-04 17:16                 ` Carlos O'Donell
2010-01-04 18:11                   ` John David Anglin
2010-01-04 18:29                     ` John David Anglin
2010-01-04 20:51                     ` Helge Deller
2010-01-04 21:39                       ` John David Anglin
2010-01-05 22:27                       ` John David Anglin
2010-01-06 23:33                         ` John David Anglin
2010-01-07 16:13                           ` Helge Deller
2010-01-08 16:37                             ` John David Anglin
2010-01-08 21:17                               ` John David Anglin
2010-02-02 21:16                                 ` Helge Deller
2010-02-03  3:44                                   ` John David Anglin
2010-02-03 22:03                                     ` Helge Deller
2010-03-07 17:12                                       ` John David Anglin
2010-03-07 20:32                                         ` John David Anglin
2010-03-11  3:20                                           ` John David Anglin
2010-03-11 13:54                                             ` Kyle McMartin
2010-03-11 22:40                                               ` John David Anglin
2010-03-11 23:32                                                 ` John David Anglin
2010-03-13  2:06                                                 ` John David Anglin
2010-03-15  1:10                                                   ` John David Anglin
2010-03-16 11:49                                                     ` Carlos O'Donell
2010-03-21 18:19                                                       ` John David Anglin
2010-03-22 14:26                                                         ` Carlos O'Donell
2010-03-23 21:32                                                         ` Carlos O'Donell
2010-03-23 22:23                                                           ` John David Anglin
2010-02-03 22:44                                   ` Carlos O'Donell
2010-01-08 21:18                               ` Helge Deller
2010-01-08 21:43                                 ` John David Anglin
2010-01-08 21:44                                 ` Carlos O'Donell
2010-01-08 21:44                                   ` Carlos O'Donell
2010-01-08 21:56                                     ` Kyle McMartin
2010-01-08 22:28                                       ` John David Anglin
2010-01-08 22:33                                         ` Kyle McMartin
2010-01-08 22:31                                     ` John David Anglin
2010-01-16 23:17                                   ` Helge Deller
2010-01-18 15:50                                     ` John David Anglin
2010-01-18 20:44                                     ` John David Anglin
2010-01-18 20:49                                       ` Carlos O'Donell
2010-01-29 17:53                                     ` Carlos O'Donell
2010-01-31 21:14                                       ` Helge Deller
2010-01-01  0:26                                         ` John David Anglin
2010-02-01 12:58                                           ` Carlos O'Donell
2010-02-01 15:47                                             ` John David Anglin
2010-02-01 19:02                                           ` Helge Deller
2010-02-01 19:11                                             ` John David Anglin
2010-02-01 21:36                                               ` Carlos O'Donell
2010-01-04 17:32                 ` John David Anglin
2010-01-04 18:02                   ` Carlos O'Donell
2010-01-04 18:22                     ` John David Anglin
2010-01-04 21:24                 ` Helge Deller
2009-12-31 22:38           ` John David Anglin
2010-01-01  0:36             ` John David Anglin
2009-12-22 15:03 John David Anglin
2009-12-22 15:52 ` Carlos O'Donell

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=20091223161504.GA13299@hiauly1.hia.nrc.ca \
    --to=dave@hiauly1.hia.nrc.ca \
    --cc=carlos@systemhalted.org \
    --cc=dave.anglin@nrc-cnrc.gc.ca \
    --cc=linux-parisc@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.