I do not like the
while( (jiffies-time_start) < 1 );
since it is too long and blocks the whole cpu from doing sensible stuff.
Back in 1996 eberhard moenkemaier wrote in this list:
----
/*
* * kernel mode waiting, time unit is jiffy (10 ms)
* */
static void jiffy_sleep(u_int time)
{
current->state = TASK_INTERRUPTIBLE;
current->timeout = jiffies + time;
schedule();
}
The task gets re-scheduled if the time has elapsed.
Calling it with 0 gives an indefinite short time, just allowing
other kernel mode tasks to get the CPU. }
---Is this still applicable and racecondition-save?
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/