Skip to contentSkip to conversation

timeout = 1 millisecond for wait_event_timeout

DISCUSSION Mockern 2 participants 2 messages Mar 5, 2007

lore
Share & tools
lore

Mockern

author
#0 lore raw

Hi,

I have a question. How can I make timeout = 1 millisecond for wait_event_timeout function?

Something like (HZ/1000)*x?

#1 lore raw
Quoted 6 lines · Mockern

Hi,

I have a question. How can I make timeout = 1 millisecond for wait_event_timeout function?

Something like (HZ/1000)*x?

You mean in a HZ-independent way?

Use msecs_to_jiffies().

Note, that if HZ==1000, you can do wait_event-( , ,0); and you will get as close to 1 millisecond as possible (there are no guarantees for schedule_timeout(), the underlying function to wait_event_timeout()).

Thanks,
Nish