Re: Multitasking in Mac OS Gets 100% CPU

new topic     » goto parent     » topic index » view thread      » older message » newer message
ghaberek said...

Interestingly, checking gnome-system-monitor with sleep(1) the "Waiting Channel" column displays hrtimer_nanosleep, but with sleep(0) it simply shows "0". Is the sleep() function not calling "nanosleep" when we pass 0 as a parameter?

-Greg

Looks like we have a bug in Wait() in be_task.c (which is used to implement the sleep() routine).

We have code in there to busy-wait if we are attempting to sleep in fractional sections, and the fractions are too small - but we also have a check so if we're sleeping for less than 1 second we just busy-wait it out.

I think this was done back when we supported DOS so we could sleep for fractional seconds from DOS apps...

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu