Re: To Insolor and those interested in dos rescue programme
- Posted by useless_ Dec 21, 2012
- 2647 views
From the task readme:
Praps you can schedule a keybd scan to happen every 0.1 seconds, instead of that loop?
useless
In Euphoria tasks do not switch automatically (even so called realtime tasks). Every task (counting the main one) must explicitly task_yield() to allow the task scheduler consider which task will run next. Examine a small example. You can see both tasks are realtime, but anyway there is task_yield() in the main loop. Try to remove it, and the tasks will not run at all.
Yes, it must task_yield, but the scheduler then won't come back to it for 0.1 seconds, even if all the other tasks yield. And i think that's all you want, is it to check the keybd once every 100ms instead of 3,750,000 times?
I sped up news.e some by not making the main code be a task. I took out a lot of possible places for a task_yield, just by putting one in http.e, which is even more time sensitive than waiting on a human at the keybd. See: http://openeuphoria.org/forum/119025.wc#119025
Just saying, 3,750,000 calls to anything, in order to not use cpu time, seems to be a lot of un-necessary wasted time, especially if the point was to be instantly available for something.
useless