I wonder how many times people have "discovered" this old attack\n<[URL]http://arstechnica.com/news.ars/post/20070711-security-paper-shows-how-applications-can-steal-cpu-cycles.html[/URL]>.\n\nThe fundamental issue is that, on your typical multitasking system,\nmeasuring the CPU time usage of a process is an inherently imprecise act.\nDoing it more accurately would itself use up so much CPU time that it\nwouldn't be worth doing. So the usual procedure is to have a per-CPU\ninterrupt routine run every clock tick and increment a CPU usage counter\nfor whatever process happens to be current on that CPU at the time.\n\nOf course, if a process can arrange to confine most of its CPU usage to the\ntimes _between_ clock ticks, that usage will end up underreported.\n\nI discovered this by accident many years ago, as a student. I was trying to\nwrite a program that would consume precisely-controlled amounts of CPU, by\nputting itself to sleep at specified intervals. On my first test, it was\nsleeping every 1/100th of a second (which happened to coincide with the\nclock tick interrupt rate on the VAX-11/750 machine I was using). It\nsucceeded in bringing the entire machine to its knees, while recording\nhardly any CPU usage at all.