Re: Multitasking in Mac OS Gets 100% CPU
- Posted by jimcbrown (admin) Nov 07, 2012
- 1362 views
ghaberek said...
mattlewis said...
In short, I don't think there is really any problem here. A busy loop should produce 100% CPU usage.
While I agree that a simple busy loop should produce 100% CPU usage, I think that a tasking loop with regular calls to sleep() should not, since the OS has the opportunity to schedule other programs.
-Greg
This raises the question: How does one go about implementing a non-busy-looping version of wait_key() that allows other tasks to run while waiting for a key press?