how is kernel notifying userspace when data arrives on a socket/fd
Linux - KernelThis forum is for all discussion relating to the Linux kernel.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
how is kernel notifying userspace when data arrives on a socket/fd
Hi All,
I was trying to find how the kernel notifies Userspace when data arrives on a socket or a socket/fd becomes writable. I know from userspace we call select() if its non-blocking and it wakes up. But my question is exactly that, how select finds this.
I've gone through a little bit of kernel TCP code. Where i'm seeing SIGIOs are being sent to the process. Is this the sole way kernel notifies uspace? What does the wake_up_interruptible() function do?
I was trying to find how the kernel notifies Userspace when data arrives on a socket or a socket/fd becomes writable. I know from userspace we call select() if its non-blocking and it wakes up. But my question is exactly that, how select finds this.
I've gone through a little bit of kernel TCP code. Where i'm seeing SIGIOs are being sent to the process. Is this the sole way kernel notifies uspace? What does the wake_up_interruptible() function do?
Thanks,
Joshith
Hello,
You also can try by asynchronous signals. In user space you will run a process which will response the kernel signals. Try LDD3 examples.
Thanks for the reply. But can you elaborate a little bit more on this.
I understand a SIGIO ie. an async signal is sent by the kernel. But I was wondering is there any other means also by which kernel notify the uspace program.
sk_wake_async(sk,0,POLL_OUT);
sk_wake_async(sk,1,POLL_IN);
sk_wake_async(sk,0,POLL_ERR); are in the send sending SIGIO. what does wake_up_interruptible() do here?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.