LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 06-25-2010, 03:14 AM   #1
jork
LQ Newbie
 
Registered: Jun 2010
Location: beweth
Distribution: Ubuntu, RHEL, Monta Vista, QNX
Posts: 16

Rep: Reputation: 0
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?


Thanks,
Joshith
 
Old 06-25-2010, 03:27 AM   #2
kumar.manoj412
Member
 
Registered: May 2007
Location: India
Distribution: Mandriva, Ubuntu
Posts: 43
Blog Entries: 1

Rep: Reputation: 16
Quote:
Originally Posted by jork View Post
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?



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.
 
Old 06-25-2010, 03:57 AM   #3
jork
LQ Newbie
 
Registered: Jun 2010
Location: beweth
Distribution: Ubuntu, RHEL, Monta Vista, QNX
Posts: 16

Original Poster
Rep: Reputation: 0
Kumar,

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?


thanks,
jork
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Clearing *all* userspace private data Vinter Linux - Desktop 3 01-09-2010 05:58 PM
Efficient kernel<->userspace data transfering maverik Programming 2 05-31-2008 02:24 AM
Passing IP options data to kernel from userspace kaushik1 Programming 2 12-26-2007 11:38 PM
a question about kernel copy userspace data linwenyuan Programming 0 03-28-2007 09:55 AM
cannot read data at server socket, though client socket sends it jacques83 Linux - Networking 0 11-15-2005 01:58 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 08:27 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration