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


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

Re: pthread rwlock deadlock detection

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From Ian Collins <ian-news@hotmail.com>
Newsgroups comp.lang.c++
Subject Re: pthread rwlock deadlock detection
Date Thu, 06 Oct 2011 20:42:23 +1300
Lines 16
Message-ID <9f54evFtu8U3@mid.individual.net> (permalink)
References <653ffd73-06b2-4df1-8a7e-367a3afdcbc3@n15g2000vbn.googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-Trace individual.net uXE1Hcjk8IPcn5DUjhqVVgEMtiEqsEtU+9SWsoi3iBoKi0ws7U
Cancel-Lock sha1:S0mm/dgcXZ5+2WitbVDlgAziy0I=
User-Agent Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:1.9.2.9) Gecko/20101021 Lightning/1.0b2 Thunderbird/3.1.4
In-Reply-To <653ffd73-06b2-4df1-8a7e-367a3afdcbc3@n15g2000vbn.googlegroups.com>
Xref x330-a1.tempe.blueboxinc.net comp.lang.c++:10692

Show key headers only | 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