Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #10688 > unrolled thread

pthread rwlock deadlock detection

Started byJaydeep Chovatia <chovatia.jaydeep@gmail.com>
First post2011-10-05 14:09 -0700
Last post2011-10-06 20:42 +1300
Articles 3 — 3 participants

Back to article view | Back to comp.lang.c++


Contents

  pthread rwlock deadlock detection Jaydeep Chovatia <chovatia.jaydeep@gmail.com> - 2011-10-05 14:09 -0700
    Re: pthread rwlock deadlock detection gwowen <gwowen@gmail.com> - 2011-10-06 00:39 -0700
    Re: pthread rwlock deadlock detection Ian Collins <ian-news@hotmail.com> - 2011-10-06 20:42 +1300

#10688 — pthread rwlock deadlock detection

FromJaydeep Chovatia <chovatia.jaydeep@gmail.com>
Date2011-10-05 14:09 -0700
Subjectpthread rwlock deadlock detection
Message-ID<653ffd73-06b2-4df1-8a7e-367a3afdcbc3@n15g2000vbn.googlegroups.com>
Hi,

I have multi-threaded program (C++, Linux) in which I am using
pthread_rwlock_t to read/write lock the critical section. Under load
my program hangs in acquiring read lock. It seems like some writer has
not released the lock. I have doubled check my source code but no
success.
Is there any way to  see thread ownership on mutex to get idea about
who is current owner? Is there any otherway to debug it?

Note: I am using PTHREAD_MUTEX_ERRORCHECK type of thread and checking
the return status while locking/unlocking. No error found during
locking/unlocking.

Thank you,
Jaydeep

[toc] | [next] | [standalone]


#10691

Fromgwowen <gwowen@gmail.com>
Date2011-10-06 00:39 -0700
Message-ID<e911bfab-72d1-4caa-ae42-0026e64379d0@q25g2000vbx.googlegroups.com>
In reply to#10688
On Oct 5, 10:09 pm, Jaydeep Chovatia <chovatia.jayd...@gmail.com>
wrote:

> Is there any way to  see thread ownership on mutex to get idea about
> who is current owner? Is there any otherway to debug it?

I've had some success with the valgrind --tool=helgrind, but its not a
panacea

[toc] | [prev] | [next] | [standalone]


#10692

FromIan Collins <ian-news@hotmail.com>
Date2011-10-06 20:42 +1300
Message-ID<9f54evFtu8U3@mid.individual.net>
In reply to#10688
On 10/ 6/11 10:09 AM, Jaydeep Chovatia wrote:
> Hi,
>
> I have multi-threaded program (C++, Linux) in which I am using
> pthread_rwlock_t to read/write lock the critical section. Under load
> my program hangs in acquiring read lock. It seems like some writer has
> not released the lock. I have doubled check my source code but no
> success.
> Is there any way to  see thread ownership on mutex to get idea about
> who is current owner? Is there any otherway to debug it?

The easiest way is to wrap the mutex and instrument it (keep the owner 
tid in the wrapper object) for debugging.

-- 
Ian Collins

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.c++


csiph-web