LinuxQuestions.org
Help answer threads with 0 replies.
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 03-18-2004, 05:53 AM   #1
TedMaul
LQ Newbie
 
Registered: Jan 2004
Location: UK
Distribution: LFS
Posts: 15

Rep: Reputation: 0
IPC (Message Queues vs. FIFOs vs. Unix-domain Sockets)


Hi.

I'm writing a program which forks, the parent exiting immediately, the child doing the necessary stuff to become a daemon and then writing its PID to a file. When the program is invoked again, it checks if the daemon is already running and if so, I'd like it to pass its command-line arguments to the daemon. Message Queues look to be a good solution to this, but after some research it seems that they are vaguely frowned-upon. Is there are a good reason not to use them? Would a named-pipe or a Unix-domain socket be a better solution? Some advice would be much appreciated.

Ultimately the daemons's goal is to control some other processes which periodically print status information to the console. My plan is for the daemon to fork each time it is asked to start a process and for the child to read the controlled process' output via a pipe. The daemon will need to be able to ask its children for the status of their controlled processes, which it will then collate and send back to the instance that woke it up, so that it can be printed to the console. Is this a reasonable design? Would message queues again be a sensible solution for this second teir? As the daemon will always outlive its children, a fourth option would be to communicate via inherited file descriptors. Again some advice would be very much appreciated.

Thanks.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
POSIX message queues(Solaris) to SYS V message queues(Linux) devershetty Programming 1 01-22-2007 11:15 AM
Posix Message queues? gdipierro Programming 20 07-26-2005 05:59 PM
Message Queues rag_mg Programming 1 05-08-2005 09:00 AM
POSIX message queues... infamous41md Programming 6 05-25-2004 03:53 PM
Message Queues BoldKiller Programming 1 05-28-2003 06:40 PM

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

All times are GMT -5. The time now is 02:26 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