update every second or every resched()? 
Author Message
 update every second or every resched()?

Should  I UPDATE the current process' priority every time resched is called?
or need  I only update all process' priority once a second?


Fri, 29 Jul 2005 10:24:21 GMT  
 update every second or every resched()?

Quote:
> Should  I UPDATE the current process' priority every time resched is
called?
> or need  I only update all process' priority once a second?

That's difficult to answer without more details.

If you're only updating the priority for the current process, and if your
priority computation is simple, then yes. If your priority computation is
not simple, you should rethink it. If you're recomputing the priority for
everything in the system at every context switch, you should rethink your
design.

The goal of the scheduler is to impose minimal overhead on the system while
switching between tasks. A few clock cycles worth of priority computation
isn't going to hurt. A few hundred (or worse -- a few thousand!) might. Then
again, 1000 cycles on a 1 GHz CPU is only 1 microsecond.

-Matt



Fri, 29 Jul 2005 12:56:34 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. How to update a texture every second?

2. every so-many seconds execute?

3. view data continuously but only record every x seconds

4. Executing Instruction once every second

5. script for every few seconds

6. Every 10 seconds?

7. Running a proc once every n seconds

8. Updating A Tkinter Window every 100 ms?

9. Substituting :: for __ in every htm file, and rename htlml file

10. every 94 chars as a new line

11. every odd newline drop

12. drop every newline in file and then ...

 

 
Powered by phpBB® Forum Software