Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 06-26-2004, 11:19 AM   #1
LQ Newbie
Registered: Sep 2003
Location: Hampshire, England
Distribution: debian
Posts: 5

Rep: Reputation: 0
pthreads stack frame lock up detection


I have a C program with 2 threads using pthreads, one thread at base level and one at higher priority that runs every 25ms on a SIGALRM timer.

I have some code in each thread to check whether the other thread has got stuck in a tight loop - i.e. in case there is a programming error. In this case I want to log where it got stuck and restart the program automatically.

Each thread kicks a watchdog every time it iterates.

For the high priority thread I simply check for a lock up in the SIGALRM handler and if the thread has locked then I do a backtrace to a file before I restart the program.

Similarly the SIGALRM handler can detect if the base thread has locked up - however my problem is finding out where it has locked. Is there a way of decoding the stack frame for a different pthread from the one that is running?

Alternatively, am I missing an easier way of detecting lock ups in a pthreads program?


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
E: Could not get lock /var/lib/dpkg/lock - open (11 Resource temporarily unavailable) phreakshew Linux - Newbie 24 04-12-2019 10:42 AM
Default stack size on Linux/glibc/pthreads? rameshnj Linux - Newbie 3 11-03-2009 02:55 AM
Difference b/t Kernel stack and User stack hazzyb Linux - Software 2 09-29-2008 07:40 PM
Frame-by-frame video jeffChuck Linux - Software 0 10-12-2004 10:04 PM
calling a frame from another frame : JAVA randomx Programming 0 10-07-2004 02:49 PM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:33 PM.

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