Re: [linux-audio-dev] How to kill a rogue (p)thread

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [linux-audio-dev] How to kill a rogue (p)thread
From: Jack O'Quin (joq_AT_io.com)
Date: Wed Mar 31 2004 - 20:39:36 EEST


Arve Knudsen <aknuds-1_AT_broadpark.no> writes:

> True .. That was one approach I considered originally while sketching
> up solutions, I guess it slipped my mind in the meantime :| I was
> thinking it could possibly be an expensive operation though as NPTL
> sources seem to indicate, maybe best avoided if memory locks are
> involved (I'm no optimization guru, I'm sure you can tell).

It doesn't look all that expensive. The magic is done by a platform-
dependent compare-and-swap operation. On some SMP machines that can
be slow, but generally only in high-contention situations (AFAIK).

> Anyway, do you think it would be good to keep a canary around to act
> on CPU starvation?

Personally, I don't see much need for a canary thread. Others may
disagree. But, a watchdog is quite helpful for debugging. In some
cases, the application will provide its own watchdog. Is it possible
for that thread to be optional?

-- 
  joq


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Wed Mar 31 2004 - 20:38:50 EEST