public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Chris Snook <csnook@redhat.com>
To: Yishai Hadas <Yishai.Hadas@aladdin.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Health monitor of a multi-threaded process
Date: Mon, 10 Sep 2007 11:35:25 -0400	[thread overview]
Message-ID: <46E5643D.50005@redhat.com> (raw)
In-Reply-To: <C4A438513D3F12459455E5D43FD54783017A2E06@extlv102.eAladdin.org>

Yishai Hadas wrote:
> Hi List,
> 
> I'm looking for any mechanism in a multi-threaded process to monitor the
> health of its running threads - or by a specific monitor thread or by
> any other mechanism.
> 
> It includes the following aspects:
> 
>     1) Threads are running and not stuck on any lock. 

If you're using posix locking, you'll never find yourself busy-waiting for very 
long.  Use ps or top.

>     2) Threads are running and have not died accidentally. 

Use ps or top.

>     3) Threads are not consuming "too much" CPU/Memory. 

Use ps or top.  You'll have to decide how much is "too much".

>     4) Threads are not in any infinite loop. 

This requires solving the Halting Problem.  If your management is demanding this 
feature, I suggest informing them that it is mathematically impossible.

Just use top or ps.  Don't reinvent the wheel.  We've got a really good wheel. 
If you don't like top or ps as is, read the ps man page to see all the fancy 
formatting it can do, and parse it with a simple script in your favorite 
scripting language.

	-- Chris

  reply	other threads:[~2007-09-10 15:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-09  9:31 Health monitor of a multi-threaded process Yishai Hadas
2007-09-10 15:35 ` Chris Snook [this message]
2007-09-10 20:50   ` David Schwartz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=46E5643D.50005@redhat.com \
    --to=csnook@redhat.com \
    --cc=Yishai.Hadas@aladdin.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox