Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8141351
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T12:28:40+00:00 2026-06-06T12:28:40+00:00

I have multiple daemons (one gateway and multiple service, all running on same node)

  • 0

I have multiple daemons (one gateway and multiple service, all running on same node) out of which some of the service daemons need to respond in “soft real time” to the arriving requests on the network, my arch is like i have a gateway daemon which routes the incoming packets based on some protocol tag to the corresponding service daemons. the service daemons process the requests and send the responses back to the gw daemon which puts on the wire. all fine and working but i am not achieving the “soft real time” and seeing a lag.

I plan to improvise on this in below way, sharing the network connection between gateway and the service daemons, i will have a notification scheme by which, when the packets arrive on the connection the gw daemon with out de-queuing the packet from the socket queue looks at the protocol header and “notifies” the corresponding service daemon that “data has arrived”, on receiving the notification the service daemon grabs a binary semaphore and de-queues the data from the socket queue. there will be 2 such semaphores one for writing and the other for reading. when the service daemon needs to send data it grabs the write semaphore and sends the data. when it receives the “data arrival ” notification from the gateway daemon, it grabs the read semaphore and de-queues the data from the socket. On every new connection request the gateway daemon will send the connection to the service daemons using “sendmsg”.

Did any body tried this scheme any time ? do you see any problems with this approach ? pls comment/advise.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T12:28:42+00:00Added an answer on June 6, 2026 at 12:28 pm

    If you want to avoid copy overhead you should probably be using splice, rather than trying to share sockets between multiple daemons. That solution is going to be fiendishly difficult to debug and maintain.

    I expect (and hope) that your network protocol has a header which makes it easy for the gateway to know where to route a packet to, followed by a payload destined for the service daemon.

    In pseudocode the gateway does this:

    while (data on socket)
    {
        header = read(socket, sizeof(header));
    
        service_socket = find_service(header);
        splice(socket, NULL, service_socket, NULL, header->payload_length, 0);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have multiple threads who all need to write to the same Dictionary. I
I have multiple elements with the same class clickable, i'm binding all these classes
I have multiple threads which need to send UDP packets to different IP addresses
I have multiple programmers contributing examples for javadocs and some examples contain comments formatted
I have multiple NSURLConnections running providing data back to the delegate objects. Is it
We have multiple copies of the same form (jobs for a resume, only hidden
I have multiple oracle connection so i have to fire the transactions on all
I have multiple webpages that work together. Most of them have the same css
I have a system with multiple threads running - my main-thread just checks if
I have multiple controllers one in Areas /Areas/Demo/Admin/AdminController and other in main site /Controller/Admin/AdminController

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.