More Re: Threads

Stanislav Krasilovskiy (prgrssor@cs.bu.edu)
Tue, 5 Oct 1999 13:21:41 -0400 (EDT)


James,

Thanks for your help. At which point do I set these fields? I try
to do it first thing in the body of the thread procedure:

current->pgrp = 1;
current->session = 1;
current->tty = NULL;

but threads still become zombies as they exit. What else could be wrong?

Thanks again.

+------------------------+----------------------------------------+
| Stan Albright Rost | http://mdsp.bu.edu/prgrssor_html |
| AKA | "Iron sharpens iron. |
| "The Progressor" | So one man sharpens another." |
+------------------------+-------------= Prov. 27:17 =-----------+

On Mon, 4 Oct 1999, B. James Phillippe wrote:

> On Mon, 4 Oct 1999, Stanislav Krasilovskiy wrote:
>
> > Hi,
> >
> > I have a short question, but I lack the expertise to answer it.
> >
> > I am creating a thread in a custom system call, through a call to
> > kernel_thread(). When this thread finishes, it becomes a zombie and
> > persists until the user program which called the system call exits. Is
>
> You want the thread to act like a daemon, then?
>
> Did you do something like this:
>
> tsk->pgrp = 1 ; /* detach from parent */
> tsk->session = 1 ; /* now owned by "init" */
> tsk->tty = NULL ; /* detach from any tty */
>
> where "tsk" is a pointer to the task_struct representing the thread?
>
> -bp
> --
> # bryan at terran dot org
> # http://www.terran.org/~bryan
>
>

-
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/