Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

which sleep function

20 views
Skip to first unread message

John

unread,
Jul 7, 2008, 1:29:22 PM7/7/08
to
Newbie here - using LynxOS 4.0 - Device Driver development

Currently I'm using the usec_sleep() function. However, this is a busy
loop. I would like to use one that suspends my process until the
amount of time (in milliseconds) has elapsed. Is there another sleep
function that I can use?

Cyril Novikov

unread,
Jul 7, 2008, 7:13:21 PM7/7/08
to

tswait() with a dummy semaphore initialized to zero. The timeout is specified in
clock ticks. For millisecond resolution, you'll have to set the clock tick rate
to 1000Hz.

John

unread,
Jul 9, 2008, 10:02:40 AM7/9/08
to

Thanks for the replay....but Newbie here.

How do I change the clock tick rate to 1000 Hz?

Cyril Novikov

unread,
Jul 9, 2008, 5:23:48 PM7/9/08
to

I'm not sure, it's been about 5 years since I last worked with 4.0. I think,
maybe change the TICKSPERSEC constant in /usr/include/conf.h to 1000 and rebuild
the kernel? (make sure conf.o is rebuilt)

--
Cyril

John

unread,
Jul 17, 2008, 10:58:28 AM7/17/08
to
On Wed, 09 Jul 2008 14:23:48 -0700, Cyril Novikov
<cnov...@mail.remove.this.ru> wrote:

Is there another way, I'm doing a device driver and I need the driver
to sleep awhile instead of doing a busy wait. Changing the TICKSPERSEC
is not an option.

Cyril Novikov

unread,
Jul 18, 2008, 12:11:18 AM7/18/08
to

Another way is to wait with the default resolution (10ms).

0 new messages