Re: Multitasking in Mac OS Gets 100% CPU
- Posted by jimcbrown (admin) Nov 07, 2012
- 1423 views
ghaberek said...
jimcbrown said...
I think this was done back when we supported DOS so we could sleep for fractional seconds from DOS apps...
So, if you're actually calling to nanosleep, you could pass that fraction directly to it, correct?
-Greg
Yes, we could. (Technically, we'd have to convert it to a set of integer values, one of which representing the micro/nanosecond value, and then pass that in - but same difference.) And in theory we'd have to busy-wait if we wanted to be able to sleep any leftover fractional value - but at such a low range, I doubt busy-waiting would make much of a difference anyways.