Quote:
and tell how you implement 'poll' in your OS.
By refusing to have blocking calls and instead have devices send messages straight to the process when a resource becomes available.
For a more traditional synchronous poll, you could have polling objects maintained in the kernel, which is for most part about moving overhead around, possibly hiding it in another thread to make the calling thread look faster. I'd probably have an interface as follows
- CreatePollGroup
- DeletePollGroup
- AddObjectToPollGroup
- RemoveObjectFromPollGroup
- Poll
- PollWithTimeout
On average this causes more overhead in raw system call code instead of having a Poll(object, object, ...) function as you might need to update the stateful polling objects in between.