checking for the amount of context switches the process underwentwhile running

Y

Yan

I just thought if this was possible under POSIX (or win32 or whatever).
As a programming excersize i wanted to think of a good way to do this.
The solution that came to mind is just have an endless loop, (the
process would listen for a signal to interrupt) and count microseconds
(or the smallest time possible, of the system clock). While the gaps
will be relatively low, the process is running, as soon as you get a gap
that's relatively large, the process has been switched and restored again.

This has no practical use, or at least i can't think of one, it's just
something I wondered if was possible to implement in a reliable
mechanism. I was reading about the inner workings of an OS and wondered
if this was possible purely from a user-space running process.


Your input?



-Yan
 
E

Eric Sosman

Yan said:
I just thought if this was possible under POSIX (or win32 or whatever).
[...]

Perhaps you should try this question in a forum
devoted to POSIX or to Win32 or to whatever. It has
nothing whatever to do with C.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,156
Messages
2,570,878
Members
47,408
Latest member
AlenaRay88

Latest Threads

Top