How select & file descriptors work...

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
purevoid

How select & file descriptors work...

Post by purevoid »

Hi,

I'm hoping someone can help me with finding some in-depth information about how select() and file descriptors work. In particular, how it can wait on several descriptors at once, and without the file descriptors blocking.

I'm also interested how to implement this in my own OS, and not necessarily using C (or lower level languages).

Kindest Regards,

Jonathan Roewen
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:How select & file descriptors work...

Post by Pype.Clicker »

if you have a thread 'sleeping' on a file descriptor, and the ability to wake it up when data get available (or when some space to write data get free), it is then sufficient to have the kernel code to check which file descriptors are now readable/writeable, modify the user-level array accordingly and remove the "send notification if state change" on the other file descriptors.
Post Reply