• Sangmin Seo's avatar
    Fix async progress problem in NBC I/O. · 6523ad97
    Sangmin Seo authored
    When the async progress thread blocked the progress engine and yielded
    control, if a thread started waiting inside a wait routine, e.g.,
    ADIOI_GEN_iwc_wait_fn, of NBC I/O implementation, a deadlock happened.
    The thread waiting continuously called MPI_Test to make progress, but
    the progress engine did not make progress because it was blocked due to
    the async progress thread.  The async progress thread tried to acquire
    the lock, but the waiting thread did not release the lock because it
    did not finish the wait routine.  Thus, it was a deadlock. This patch
    fixes this deadlock problem by forcing the waiting thread to yield if
    the progress engine has been blocked by another thread.
    Fixes #2202
    Signed-off-by: Rob Latham's avatarRob Latham <robl@mcs.anl.gov>