LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-16-2005, 01:12 PM   #1
lordofring
Member
 
Registered: Feb 2005
Posts: 91

Rep: Reputation: 15
wait_event_interruptible with timeout


Hello,

My kernel is 2.4.27. I would like to wait with timeout until a conditon is met. May I do it in this way?
j = jiffies + delay * HZ;
wait_event_interruptible(my_queue, (my_condition || jiffies > j))?

I suspose that it's a bad solution. What's the better one?

lordofring
 
Old 08-17-2005, 10:10 PM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
Could you just use a plain timer (i.e. init_timer and add_timer)? I know they're available in the 2.6 kernels, but I *think* 2.4 has them too. Unfortunately, I can't check at the moment.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
question about wait_event_interruptible lordofring Programming 5 08-26-2005 03:04 AM
signal in the kernel for wait_event_interruptible() lordofring Programming 3 08-23-2005 03:14 PM
timeout help amjad General 0 06-11-2005 02:39 AM
wait_event_interruptible - invalid lvalue in unary `&' 7.e.Q Programming 4 11-08-2004 02:00 AM
LQ timeout... again gui10 LQ Suggestions & Feedback 4 05-02-2002 12:33 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:57 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration