1

I am working on an embedded application running on Linux kernel. I need to add another auxiliary application that will communicate with the main application by opening a socket between two applications. There is another option to embed this auxiliary application to main application as a new thread, but this will cost so much time to rearrenge.

What is the advantages/disadvantages of using standalone auxiliary applications? What would be the possible misbehavior or problems that we would encounter? I am waiting for your wise hand-on and/or technical experience.

Thanks

jeb
  • 78,592
  • 17
  • 171
  • 225
Marduc
  • 37
  • 9
  • *"What is the advantages/disadvantages of using standalone auxiliary applications?"* -- Define your use of *"standalone"* and *"auxiliary"*. "Standalone" is usually opposite to application and OS, and synonymous with bare-metal. In more conventional terminology, seems like you're trying to compare two processes (aka multiprocessing) versus multithreading. See https://stackoverflow.com/questions/3044580/multiprocessing-vs-threading-python/3044626#3044626 and its comments, which are not really Python-specific. – sawdust May 15 '18 at 22:17
  • See https://blogs.datalogics.com/2013/09/25/threads-vs-processes-for-program-parallelization/ – sawdust May 15 '18 at 22:24
  • Possible duplicate of [When to choose multithreading or multiprocessing?](https://stackoverflow.com/questions/19928256/when-to-choose-multithreading-or-multiprocessing) – sawdust May 15 '18 at 22:32
  • those sources would be great. Thanks – Marduc May 16 '18 at 07:25

1 Answers1

0

Disadvantages of communication over socket:

  • Alower than shared memory.
  • Additional coding effort.
  • Third application might hijack socket.

Advantages of communication over socket:

  • Easily extendable to usage of separate systems for the two processes.
  • The two applications can be programmed in totally different languages and could use different bitness.
  • One application can be changed without touching the other if the protocol stays the same.
Xypron
  • 2,215
  • 1
  • 12
  • 24