Waking up kernel thread blocked in sock_recvmsg

Waking up kernel thread blocked in sock_recvmsg

Post by Steven Frenc » Thu, 10 Oct 2002 01:10:06



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.

Steve French
Samba Team
Senior Software Engineer
Linux Technology Center - IBM Austin
phone: 512-838-2294

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

Waking up kernel thread blocked in sock_recvmsg

Post by Andi Klee » Thu, 10 Oct 2002 01:50:06



> 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

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

1. Waking up a thread blocked on accept()

Hi guys,

I have a thread blocked on an accept() call. I'd like to wake it up from
another thread. How do I do that ?

Under WIN32, I just close the socket, and the accept() returns with an
error code.

---

ConnectTel, Inc.                    Austin, TX -- USA
Phone : 512-338-1111                Fax : 512-918-0449
Company Page:     http://www.connecttel.com
Home Page:        http://members.nbci.com/rosimildo/

2. g++ problem

3. Waking a blocked SCHED_RR thread form ISR

4. QuakeII QuakeII nVidia TNT and TNT2

5. Waking up a user thread from kernel code

6. Httpd process leaking memory

7. Help: Kernel thread wakes up too late

8. *****Web Page Design and Publishing******

9. What happens when sock_recvmsg blocks infinately??

10. Waking up a user thread from kernel code

11. threads packages: kernel threads vs. user threads

12. kernel hangs in sock_recvmsg

13. How i sleep a thread, and doesn't block another thread?