Re: Locking a process or thread onto a specific CPU

Alexander S A Kjeldaas (astor@fast.no)
Fri, 19 Feb 1999 00:15:05 +0100 (CET)


On Fri, 19 Feb 1999, Keith Owens wrote:

> On Thu, 18 Feb 1999 16:36:50 +0100,
> Alexander Kjeldaas <astor@fast.no> wrote:
> >Once in a while, a
> >student would write a program that essentially forked in a loop where
> >the parent process exited. This kind of process is _hard_ to kill
> >since neither is it visible using 'ps', nor is the PID constant. In
> >IRIX, it is easy to solve this problem by disabling 3 CPUs [snip].
> >In Linux, on a 4-way SMP system, you're stuck.
>
> Getting a little off topic, but you do not need to disable CPUs to fix
> that particular problem. Just get the process group id or session id
> (PGID or SID columns from ps xaj) and kill -9 -pgid or kill -9 -sid.
>

Consider the case where the process does a setsid() after fork(). The
problem doesn't go away.

astor

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/