Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 11-08-2006, 03:35 PM   #1
LQ Newbie
Registered: Jan 2006
Posts: 2

Rep: Reputation: 0
How does a blocking select return (kernel)?


I've been looking around but could not find anything that's relevant to kernel space.

I'm having trouble understanding how a blocking select (timeout = NULL) would return.

For instance, in the 2.6 kernel, if do_select() doesn't find any sockets available for read, it would block with schedule_timeout(MAX_SCHEDULE_TIMEOUT) with current->state = TASK_INTERRUPTIBLE.

Now when the read resource becomes available, how does the kernel put the blocked task (select() caller) back on the runqueue?

Thanks in advance for any help or pointers to other documentation.
Old 11-09-2006, 04:52 PM   #2
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
Blocking socket returns when an event occurs. As a part of such handling there's a check made and if it's needed, owner of the descriptor is woken up. That's the most basic way. There are different factors, however. To see it all, browse driver code (eg. serial driver) to see what happens when it's notfied that there's new data (when we think about communication-related drivers).

Last edited by Mara; 11-09-2006 at 04:55 PM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Can I select the kernel version when installing? davcefai Debian 3 01-02-2006 05:37 PM
How do I select which kernel the server boots with? grub.conf? abefroman SUSE / openSUSE 3 06-20-2005 03:56 PM
2.6 kernel will only boot when I select it with LILO foamrotreturns Linux - Newbie 4 11-29-2004 12:18 PM
Select some modules in the kernel! romasport Linux - General 4 05-25-2004 01:05 PM
can't select reiserfs during kernel configuration paavaka Linux - General 2 10-15-2001 05:58 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:31 AM.

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