Re: Multitasking in Mac OS Gets 100% CPU
- Posted by mattlewis (admin) Nov 05, 2012
- 1513 views
bryanso said...
The following naive implementation of get_key with multitasking support causes 100% CPU in Mac OS (Mountain Lion, Eu 4.0.4). Is there a better practice? This does not cause high CPU usage in Windows 7.
Is there something I can do in Mac OS to reduce the CPU consumption?
It's hard to say without seeing more of your code. Where does execution go when you call task_yield()? get_key() returns immediately. There's nothing there really that would lead me to believe that you'd get anything but 100% utilization until a key is pressed.
Matt