Re: Q: waiting for a short time and not beeing a resource hog

Alan Cox (alan@lxorguk.ukuu.org.uk)
Wed, 1 Dec 1999 14:28:36 +0000 (GMT)


> I do not like the
>
> while( (jiffies-time_start) < 1 );
>
> since it is too long and blocks the whole cpu from doing sensible stuff.

If its 1/100th of a second or so then its worth delaying using a timer
if this is an irq - add a timer to call the function to read the data. If its
very short times like 50uS or so just use udelay and eat the cost


-
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/