LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-28-2005, 07:28 AM   #1
subu_s
Member
 
Registered: Jun 2004
Posts: 36

Rep: Reputation: 15
Debugging mutexes


Hi,
I am new to multi threaded programming using mutexes.
I am getting an error using mutexes wherein a thread seems to be locking a mutex and another thread too is trying to lock the same one.

Now my question is regarding debugging mutexes. Is there any system command for mutexes, the way we have ipcrm, ipcs for semaphores?

Please help.

Regards,
Subu
 
Old 03-01-2005, 11:52 PM   #2
jwstric2
Member
 
Registered: Jan 2004
Posts: 105

Rep: Reputation: 15
I don't know of any off hand, course maybe another user does. There's no problem with two threads trying to lock the same mutex as long as

1. Someone finally releases
2. Its not being reaquired by the same calling thread

Under pthreads you can define different types of mutexes, one being an error check mutex. I've used it before. If a thread tries to lock a mutex already locked by him it will fail, well see man pthread_mutex_lock. Another is to build a logger for each thread before and after every lock and unlock. Posting the code might help out a little..
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
problems in locking multiple mutexes stephenwalter Programming 4 11-14-2005 02:52 AM
Debugging Mercurius Programming 3 10-19-2005 02:59 PM
Visual Debugging and Linux Kernel Debugging Igor007 Programming 0 09-30-2005 10:33 AM
Threads and Mutexes jonty_11 Programming 4 04-05-2005 03:51 PM
debugging devit Programming 1 02-10-2004 11:49 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:34 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration