开发者

How to force programs out of swap file when a resources-intensive batch finishes?

We use employees' desktops for CPU-intensive simulation during the night. Desktops run Windows - usually Windows XP. Employees don't log off, they just lock the desktops, switch off their monitors and go.

Every employ开发者_如何学编程ee has a configuration file which he can edit to specify when he is most likely out of office. When that time comes a background program grabs data for simulation from the server, spawns worker processes, watches them, gets results and sends them to the server. When the time specified by the employee elapses simulation stops so that normal desktop usage is not interfered.

The problem is that simuation consumes a lot of memory, so when the worker processes run they force other programs into the swap file. So when the employee comes all the programs he left are luggish and slow until he opens them one by one so that they are unswapped.

Is there a way the program can force other programs out of swap file when it stops simulation so that they again run smoothly?


Loop through system and user processes, starting with one that uses most memory (aside from your background application) or one that is used most by the employee, and send the process a WM_ACTIVATEAPP message. That should have the same effect as "clicking" an application window icon of said process in the taskbar.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜