This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: if pthread_mutexattr_setrobust_np is set, process will hang in multi process system. in glibc -2.5
- From: "Carlos O'Donell" <carlos at systemhalted dot org>
- To: guruswamy B <guru2018 at gmail dot com>
- Cc: libc-help at sourceware dot org
- Date: Wed, 21 Apr 2010 10:34:56 -0400
- Subject: Re: if pthread_mutexattr_setrobust_np is set, process will hang in multi process system. in glibc -2.5
- References: <j2p12b1d6871004200135q1114242v9f4bf6a760ba5a6a@mail.gmail.com>
On Tue, Apr 20, 2010 at 4:35 AM, guruswamy B <guru2018@gmail.com> wrote:
> In one of my application, I need to set the pthread_mutex attribute to
> PTHREAD_MUTEX_ROBUST_NP, so that when any of the process is exited or
> killed ?with out releasing the lock, I can get back the lock.
>
> But later i found, in multi processor environment, if we set the
> robust flag, the process will hang. (see this link
> http://sourceware.org/ml/libc-ports/2007-05/msg00054.html)
> But later i found, it was working if i set the PTHREAD_PRIO_INHERIT attribute.
>
> May i know why its started working, once i set PTHREAD_PRIO_INHERIT.
> Also will this have any effect on normal working of my application.
>
> I am using glibc-2.5.
> processor is mips 16 core.
Are you able to update to a newer glibc to test if this is still a problem?
I work for CodeSourcery, and Sourcery G++ for MIPS GNU/Linux has a
sysroot you can use to test this quickly
(http://www.codesourcery.com/sgpp/datasheet?target_arch=MIPS&target_os=GNU%2FLinux)
e.g. build your application against the newer glibc in Sourcery G++
(-Wl,-rpath and -Wl,--dynamic-linker pointing to the new libs and ld
in the sysroot), and run it on your target.
Cheers,
Carlos.