By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,423 Members | 1,701 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,423 IT Pros & Developers. It's quick & easy.

read() and write() behavior in *NIX

P: 86
When the file descriptor on which read() and write() apply is set up in such a way so that these syscalls block (for instance, until no data is available to read() from a serial port), I wonder following:

What's the processor doing with this process while waiting, in general, in a *NIX? Is it busy-waiting, or sleeping?
Nov 19 '08 #1
Share this Question
Share on Google+
3 Replies


Expert 10K+
P: 11,448
It's going to schedule another task/process because your task can't run anymore.

kind regards,

Jos
Nov 19 '08 #2

P: 86
Who'll remember my task is waiting for a semaphore? The OS?
Nov 19 '08 #3

100+
P: 256
Who'll remember my task is waiting for a semaphore? The OS?
I would say so - process scheduling is part of the OS's job description.
Nov 19 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.