Quote:
Originally posted by jim mcnamara
What you are interested in are known as atomic system calls. These are guaranteed to complete without interruption.
These are common interrupts:
1. pre-empted by the scheduler which is a process context change
2. swapped out
3. signal receipt and processing
For example dup2() is atomic, gettimeofday() is not.
The only reason you really need to worry about things like this is in the case of threading.
{...snip...}
Swapping is the least of your worries.
|
I'm familiar with atomic system calls, and that gettimeofday() is not one of them.
And swapping is one of my
BIGGEST worries.
The sytem I'm using is actually an embedded system, but the vendor decided to use
a "generic" Linux distribution instead of a real-time distribution.
When an event happens, it needs to be time tagged. And the system is such that,
at best, if I get swapped it will be at least 20ms before I get another timeslice. I've
seen 240ms intervals between my timeslices.
I can handle some of that if I know that, for example, gettimeofday() returns the
time of the call, not the time after the swap.
Bill