Open MPI logo

Open MPI Development Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Development mailing list

Subject: Re: [OMPI devel] opal_condition_wait
From: Tim Prins (tprins_at_[hidden])
Date: 2007-12-06 10:08:59


Tim Prins wrote:
> Hi,
>
> A couple of questions.
>
> First, in opal_condition_wait (condition.h:97) we do not release the
> passed mutex if opal_using_threads() is not set. Is there a reason for
> this? I ask since this violates the way condition variables are supposed
> to work, and it seems like there are situations where this could cause
> deadlock.
So in (partial) answer to my own email, this is because throughout the
code we do:
OPAL_THREAD_LOCK(m)
opal_condition_wait(cond, m);
OPAL_THREAD_UNLOCK(m)

So this relies on opal_condition_wait not touching the lock. This
explains it, but it still seems very wrong.

>
> Also, when we are using threads, there is a case where we do not
> decrement the signaled count, in condition.h:84. Gleb put this in in
> r9451, however the change does not make sense to me. I think that the
> signal count should always be decremented.
>
> Can anyone shine any light on these issues?
>
> Thanks,
>
> Tim
> _______________________________________________
> devel mailing list
> devel_at_[hidden]
> http://www.open-mpi.org/mailman/listinfo.cgi/devel