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 11-29-2010, 08:18 AM   #1
chatunman
LQ Newbie
 
Registered: Nov 2010
Location: Spain
Distribution: Ubuntu, Buildroot...
Posts: 3

Rep: Reputation: 0
How can I put a process to sleep, and Wake it when something is written to its FIFO?


Hello everyone:

First post asking for help here. I will try to be as descriptive as I can.

I am working on a system with many processes that communicate to each other through FIFOs transferring data. Among them, there is a DBManager process that gets all the input coming from the other processes.

I need to make the system more responsive, by working on that DBManager.

This DBManager process is getting all the input information by regularly polling the FIFOs. The problem, is that I cannot just reduce the polling time to increase the responsiveness since it's running on an embedded system, and I would be wasting too much CPU time.

Is there a way that I could put that process to sleep, and somehow awake it when something is put on the FIFO without having to switch to a RTLinux kernel? I have been trying to find information about that all over the internet, and on these forums, but I can't seem to be able to find a mechanism that would help me in that.

Thanks in advance for all of your help.

Regards,

Chatunman.
 
Old 11-29-2010, 09:19 AM   #2
wje_lq
Member
 
Registered: Sep 2007
Location: Mariposa
Distribution: FreeBSD,Debian wheezy
Posts: 811

Rep: Reputation: 179Reputation: 179
In the name of the Flying Spaghetti Monster,

Have you tried select()?
Code:
man 2 select
 
Old 11-30-2010, 01:38 AM   #3
chatunman
LQ Newbie
 
Registered: Nov 2010
Location: Spain
Distribution: Ubuntu, Buildroot...
Posts: 3

Original Poster
Rep: Reputation: 0
Thanks a million! It seems it can work! I will try to implement that, and I'll post back if it fits my needs.
 
  


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
Howto put linux in sleep mode at 1 am and wake up at 6 am automatically Geert86 Linux - General 15 01-08-2010 08:32 PM
System goes into sleep mode, can't wake it up. Have to reboot. BHT Linux - Newbie 2 12-16-2008 06:16 AM
Display goes to sleep on boot - won't wake up without X! Clean3d Ubuntu 1 01-27-2008 08:39 PM
how to wake up from S3 acpi sleep state? bluesmanu Linux - Laptop and Netbook 4 01-15-2006 03:22 PM
Screen does not wake up after going to sleep at promp PSIPHON Linux - General 1 08-09-2005 08:30 PM

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

All times are GMT -5. The time now is 12:39 AM.

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