LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-21-2018, 11:56 PM   #1
ghhbak
LQ Newbie
 
Registered: May 2018
Posts: 9

Rep: Reputation: Disabled
Best approach for producer consumer application


I need help on a problem. The requirement is to transfer one of the DHCP option parameters from DHCP client (udhcp from busybox) to a separate and independent application running on the same device (which I'll call app2), which will consume this information. After examining the syslogs, I noticed app2 runs earlier than the dhcp client, so the information is not able to be transmitted in time. I tried using shared memory approach to transmit the information, it works. But I have to restart app2 in order for it to receive the information and successfully consume it. This may not be the optimal solution. My goal is to identify the best design choice.
 
Old 08-22-2018, 12:54 AM   #2
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,513

Rep: Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004
What kind of device is this? Does it use systemd?
 
Old 08-22-2018, 06:37 AM   #3
rtmistler
Moderator
 
Registered: Mar 2011
Location: MA, USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 7,992
Blog Entries: 13

Rep: Reputation: 3443Reputation: 3443Reputation: 3443Reputation: 3443Reputation: 3443Reputation: 3443Reputation: 3443Reputation: 3443Reputation: 3443Reputation: 3443Reputation: 3443
This depends a lot on the need for the boot up sequencing to stay the way it is, as well as whether or not this additional app is something you're writing.

If you can alter the boot up sequencing, then consider that approach and if it solves your issue, then great.

If the boot up sequence must stay the way it is, but you are coding this app, then you can code it in such as way that it waits until the information is available.

Really you have to expand a lot more on your descriptions.

Every case is different. There are a number of manners to conduct IPC in Linux, and shared memory is one of them. Meanwhile I'm wondering how the udhcpd from Busybox would be employing SHMEM, unless you'e modifying that code too.
 
Old 08-22-2018, 11:31 PM   #4
ghhbak
LQ Newbie
 
Registered: May 2018
Posts: 9

Original Poster
Rep: Reputation: Disabled
This device is a target board running openwrt, doesn't have systemd.

I had modifed the udhcpd to use SHMEM successfully. I have now tried the approach of changing the boot sequence order by editing the files under /etc/rc.d. The results look good. This approach resolves my issue. 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
Producer Consumer problem (bounded buffer) vikasbansal27 Programming 5 06-02-2012 04:00 AM
Fast Producer, Slow Consumer eviatarkhen Linux - Software 1 03-08-2012 11:57 AM
Producer and Consumer problem teesha Linux - Kernel 1 02-26-2012 11:58 PM
script to sync producer consumer application. ufmale Programming 2 06-08-2010 09:55 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:56 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration