shared memory pro:
con:
pipe pro:
cons
message queue:
cons:
Using a true message queue tends to leave you with fixed sized messages.
reference:
http://stackoverflow.com/questions/9308392/whats-the-advantages-and-disadvantages-of-using-socket-in-ipc
http://www.cs.vsb.cz/grygarek/dosys/IPC.txt
- fasted communcation
- but fastest IPC
- if multiple process want to access at the same time then shared memory is prefer
- no data transfer is happens here
- but sync is required
con:
- sync need
pipe pro:
- give two end and indpendently read and write
cons
- process of same tree only can use it
- need kernel to transfer the data
- uni directional communcation
- communcation happen via kernel
- unidirectional may be disadvanatages since sockets and all bi directional
- can use the process in diffrent system can communicate.
- Using a true message queue tends to leave you with fixed sized messages. If you have a large number of messages of wildly varying sizes this can become a performance problem. Using a socket can be a way around this,
- You can connect a simple client to them for testing (manually enter data, see the response). This is very useful for debugging, simulating and blackbox testing.
- You can run the processes on different machines. This can be useful for scalability and is very helpful in debugging / testing if you work in embedded software.
- It becomes very easy to expose your process as a service
- Overhead is greater than IPC optimized for a single machine. Shared memory in particular is better if you need the performance, and you know your processes are all on the same machine.
- Security - if your client apps can connect so can anyone else, if you're not careful about authentication. Data can also be sniffed if you're not encrypting, and modified if you're not at least signing data sent over the wire.
message queue:
cons:
Using a true message queue tends to leave you with fixed sized messages.
reference:
http://stackoverflow.com/questions/9308392/whats-the-advantages-and-disadvantages-of-using-socket-in-ipc
http://www.cs.vsb.cz/grygarek/dosys/IPC.txt
No comments:
Post a Comment