How can I implement an accurate timer under the heavey loading situation!
Hello! I hope I could measure some data (such as CPU Usage, Memory Usage..etc) every 1 second for my research to check the situation under the heavy loading (for example CPU usage 100%). However, if I use the function "settimer()", sometimes I can not get data for several seconds because of heavy loading. Therefore, the timer is not accurate. How can I implement the timer which can execute the timer function exactly every 1 second. I think the error about 100 ms is fine for me!
I know the RTAI kernel can help me to do that. But I just want to measure the data under some specific kernel. Is there any way can help me to do that without kernel modification or change. Thank you very much! |
Set your priocess priority to realtime.
The nice() function allows privleged users to set priority values. |
You could try the function munlockall which prevents all pages associated with your process from being paged. Use this in conjunction with nice() and/or setpriority(). I'd suggest you google these terms in conjuction because there may be some tricks that help
|
Thanks for your response! I am appreciating that!:)
I will try to use mlockall and nice function to implement my program! Thanks again! |
All times are GMT -5. The time now is 11:42 PM. |