Novice Programming Problems

Source: Internet
Author: User
Beginner programming problems-General Linux technology-Linux programming and kernel information. The following is a detailed description. Recently, I developed an application project in linux. System A is connected to subsystems B and C through Ethernet.
B is responsible for sending some commands to A. After A breaks down the commands, it notifies C to execute them.
For A, there is A common processing scenario.
1. after receiving the instruction from B, A sends the instruction to C. after receiving the instruction, C immediately replies "received ". C command execution result
A periodic packet is sent to.

Currently, we need to design the software structure. This is my consideration.
Scenario 1:
A process Pb is used to receive B's instructions. The processing of each command is designed as a process Pn. P1 is used according to different instructions
Exec to create Pn. Pn sends new commands to C, and then processes Pn wait for system C's reply to continue monitoring
Feedback information in periodic packets. After the command is successfully executed by C, the Pn process exits.

However, there is a problem:
For communication between system A and system C, A process Pc must receive packets from system C. After receiving the message, you must distribute it.
To the specified Pn. Due to the large number of Pn, if inter-process communication is adopted, the Pc should deal with a lot of Pn,
Is there any good solution.

Please recommend some good architectures or models.
I developed it in C language. Thank you.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.