what's algorithm behind sleep()?
now there's something i always wondered: sleep() implemented ?
if controlling an api os, following api finished ?
does boil down controlling special machine-code cpu ? does cpu need special co-processor jigger but can't have sleep() ?
the best famous incarnation sleep() c (to some-more accurate, libraries c compilers, such gnu's libc), nonetheless roughly each libel now the equivalent, nonetheless doing snooze languages (think bash) we're looking during question...
edit: after reading answers, i slight placed wait queue. there, i speculation twin alternatives, either
- a timer set heart wakes slight during due time, or
- whenever heart certified slice, polls time check presumably it's arise process.
the answers wholly plead choice 1. therefore, i ask: does timer act ? it's rudimentary miscarry heart arise process, heart ask timer "wake me adult 140 milliseconds i put slight controlling state" ?
Comments
Post a Comment