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


Groups > comp.lang.c++ > #10692

Re: pthread rwlock deadlock detection

From Ian Collins <ian-news@hotmail.com>
Newsgroups comp.lang.c++
Subject Re: pthread rwlock deadlock detection
Date 2011-10-06 20:42 +1300
Message-ID <9f54evFtu8U3@mid.individual.net> (permalink)
References <653ffd73-06b2-4df1-8a7e-367a3afdcbc3@n15g2000vbn.googlegroups.com>

Show all headers | View raw


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

Back to comp.lang.c++ | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

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

csiph-web