Quote:
Originally Posted by ekapalka
...so is it considered good practice to add it in? If your code is entirely event based (or using threads), would you really need it?
|
It depends on how you implement the thread. If you create a thread which runs continuously in an infinite loop within the thread, then you need to slow down the frequency of that loop by yielding the processor for a period of time every pass through the loop.
If the thread is created, does its thing, and then exits, you don't need the yield in the thread. You just need to make sure that the parent process that is creating that thread limits the frequency at which it creates the thread.