Re: Multitasking in Mac OS Gets 100% CPU

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

Hi Matt, thanks for the suggestion. It's a command shell so it's waiting for user to run something in the background, e.g. in Unix shell, one can put an & at the end of a command to run it in the background.

Ideally the input routine doesn't need to be written in two ways: wait_key when nothing is running in background; switch to get_key when there is a background job, and somehow switch back to wait_key when the background jobs complete. That's very complicated.

Again, I'll post a streamlined test case later, which will make it clear.

mattlewis said...
bryanso said...

Hi Ryan, I think I can't use task_delay(5) in a loop that's getting user input. The user will feel the keyboard is sluggish.

If you're not really doing anything else, and this is a console program, then you should probably be using wait_key().

Matt

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

Search



Quick Links

User menu

Not signed in.

Misc Menu