Re: Waking up kernel thread blocked in sock_recvmsg

From: Andi Kleen (ak@suse.de)
Date: Tue Oct 08 2002 - 18:25:03 EST


"Steven French" <sfrench@us.ibm.com> writes:

> What is the recommended, safe way to wake up a kernel thread blocked in
> sock_recvmsg (other than sending data to it or pulling the network cable
> out of the wall and generating network errors). I have tried various
> approaches in kernel sock_close, sock_release even wake_up_process. When
> I want to free my captive kernel threads this thread is typically blocked
> in tcp_recv_data (on a blocking read of a tcp v4 socket). I am not certain
> that it is not waking up and promptly going back to sleep but it is
> certainly not returning to the caller until it really gets data.

You could send it a signal.

Or alternatively use non blocking sockets and sleep yourself on the socket
wait queue.

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



This archive was generated by hypermail 2b29 : Tue Oct 15 2002 - 22:00:29 EST