A list of puns related to "Inter Process Communication"
I have read several Erlang books and website tutorials in the last few weeks. Now I am looking for one specific chapter I skimmed through and I am unable to remember / find in which book I read it:
It was a chapter about Erlang server abstractions. In the introduction, the author explained that this is an "eye opening concept that captures the essence of Erlang" or something to that effect. Then he explained how to create a simple Erlang server for accepting universal remote procedure calls (by sending anonymous functions to the server process). He finished the chapter with an anecdote about him installing these "mini servers" on all available hardware in different datacenters and only later deciding what to use these "prefabricated servers" for.
Now I want to get back to this chapter and read it carefully but I am unable to find it in all my PDFs. Any idea which chapter in which book this was?
UPDATE: Found it. It's "Programming Erlang, Second Edition" by Joe Armstrong, chapter 22.1: "The Road to the Generic Server": This is the most important section in the entire book, so read it once, read ittwice, read it a hundred timesβjust make sure the message sinks in.
The IPC mechanism that tends to come to mind is RESTful APIs, as this is still the most widely used, but other options have emerged that might be a better fit for specific use cases.
>Credit: https://blog.container-solutions.com/wtf-is-inter-process-communication
Credit: https://github.com/eliben/code-for-blog/tree/master/2019/unix-domain-sockets-go
I created a little example application that includes code for client/server to demonstrate IPC communication in Go.
client.go
package main
import (
"io"
"log"
"net"
"time"
)
func reader(r io.Reader) {
buf := make([]byte, 1024)
n, err := r.Read(buf[:])
if err != nil {
return
}
println("Client got:", string(buf[0:n]))
}
func main() {
c, err := net.Dial("unix", "/tmp/echo.sock")
if err != nil {
log.Fatal(err)
}
defer c.Close()
_, err = c.Write([]byte("hi"))
if err != nil {
log.Fatal("write error:", err)
}
reader(c)
time.Sleep(100 * time.Millisecond)
}
server.go
package main
import (
"io"
"log"
"net"
"time"
)
func reader(r io.Reader) {
buf := make([]byte, 1024)
n, err := r.Read(buf[:])
if err != nil {
return
}
println("Client got:", string(buf[0:n]))
}
func main() {
c, err := net.Dial("unix", "/tmp/echo.sock")
if err != nil {
log.Fatal(err)
}
defer c.Close()
_, err = c.Write([]byte("hi"))
if err != nil {
log.Fatal("write error:", err)
}
reader(c)
time.Sleep(100 * time.Millisecond)
}
I'll hope, it might be helpful to you.
Which is the best method?
trying to figure out the best way to implement a cross-platform app, with a Deamon that works as a backend
https://github.com/Noovolari/leapp/discussions/53
https://github.com/LiveAsynchronousVisualizedArchitecture/simdb
Hash based key-value store created to be a fundamental piece of a larger software architecture.
High Performance - Real benchmarking needs to be done, but superficial loops seem to run conservatively at 500,000 small get() and put() calls per logical core per second. Because it is lock free the performance scales well while using at least a dozen threads.
Shared Memory - Uses shared memory maps on Windows, Linux, and OS X without relying on any external dependencies. This makes it exceptionally good at interprocess communication.
Lock Free - The user facing functions are thread-safe and lock free with the exception of the constructor (to avoid race conditions between multiple processes creating the memory mapped file at the same time).
Cross Platform - Compiles with Visual Studio 2013 and ICC 15.0 on Windows, gcc 5.4 on Linux, gcc on OS X, and clang on OS X.
Single File - simdb.hpp and the C++11 standard library is all you need. No Windows SDK or any other dependencies, not even from the parent project.
Apache 2.0 License - No need to GPL your whole program to include one file.
https://manisuec.blog/2018/08/16/clustering-and-ipc-nodejs.html
My first tech blog on 'Clustering & Inter Process Communication (IPC) in NodeJS'. It was initially posted on medium https://medium.com/js-imaginea/clustering-inter-process-communication-ipc-in-node-js-748f981214e9 But given the restrictions Medium is putting on, I decided to setup my own blog space.
Request for your feedback....
I have been working the Advent of Code problems in Scheme and a lot of them involve making and using a program ( read-opcode
) that takes in numbers and interprets them as instructions or data.
Instruction 3 reads input and instruction 4 reads output. At first I implemented these as read
and (lambda (out) (display out)(newline))
, respectively. Later on other programs need to use the output and send input so I re-implemented 4 as:
(lambda (out)
(list (lambda (input) (recur ... input out)) out))
(recur is the named let that handles the op-codes)
and the programs that interact with read-opcode
work like:
(match-let* (((resume1 output1) (read-opcode opcodes input1))
((resume2 output2) (resume1 input2))
...)
...)
which all works, but I keep wondering if instead of returning (closures? callbacks?) I should be using ports or something else to communicate between the different instances of read-opcode
and the other programs that communicate with it.
Feel free to give in your inputs/feedback and I can work on them.
Thanks for the support!
I understand that IPC is used so that two processes can communicate. What does that actually mean? Does it mean I can send a string for example from one program to another program. What is it used for? Also I see many projects on github that do IPC using networking libraries. Why would you need networking libraries, connecting to ports, and sockets if you are just communicating to another process on your computer? Can someone ELI5?
This is the part I of a series of practical posts that I am writing to help developers and architects understand and build microservices.
This blog post is about the messaging part from a publisher microservice to a subscriber microservice using Amazon SNS/SQS.
I am sharing with you the part I of the benchmark results: Benchmarking Amazon SNS & SQS For Inter-Process Communication In A Microservices Architecture but I would like to know if anyone knows a good online post mortem/blog post about using SNS/SQS in microservices/distributed software.
This is the link: Benchmarking Amazon SNS & SQS For Inter-Process Communication In A Microservices Architecture.
I recently refreshed and re-released background-service-lib. It's a library to help you with common issues developing Android apps and Services. If you've experienced this headache before, then you'll appreciate the extra help:
Instructions for inclusion through Gradle, a demonstration app, and detailed information about usage are all available at the Github repo:
A little background, I have been developing a Xamarin forms app that collects EEG data continuously generated from a BCI (brain computer interface) cap as a user performs brain activity (left arm or right arm movement, a user imagines lifting a left dumbbell or right dumbbell). This EEG data is then continuously classified using an ML algorithm to produce a control signal of -1 to 1.
This control signal will then be used to control the left or right movement of a character in a Unity3d game. Now the problem is, since they are two different apps, I will need a way to send the classifer's output from Xamarin Forms app to Unity3d app. I was looking into Android background services in Xamarin but I'm not entirely sure if a background service is capable enough to send data to the Unity app continuously at the rate of 4-8 ms (the rate at which data is classified). Is background service a good idea or are there any alternative ways to achieve this?
The Xamarin Forms app does a lot more than just producing the control signal but in the worst case the only option is to re-create the Xamarin forms app from scratch in Unity so I don't have to handle the inter-process communication but again I don't think it's a good idea to use Unity for a non-game app dev.?
Any help or advice would be greatly appreciated. Thank you in advance!
EDIT: Sorry I didn't make it clear. Both the apps run on the same mobile device. I'm already using UDP and this will work if they are on two separate devices. But if they are on the same device, XF apps still need to continue running the classifier code and send the output to the unity game in a background service and I'm not sure if this is doable
Does vulkan provide any mechanism to transfer data (images or buffers) between applications on the gpu?
I know that I can memcpy it from the gpu to the system/host and do the transfer there and then transfer it back to the exact same gpu, but this feels fairly wasteful & slow(er) than it could be.
Thanks in advance!
So I'm trying to make a proof-of-concept with the modules Node.js comes with. With the two files together (posted below) I have a throughput between them of about 670 messages per second, all over a UNIX socket. I've been following Node.js' net API but I am still thinking there is a better/faster way to have two processes communicate. Does anybody know if I can unlock greater speeds?
Receiver code:
"use strict";
let count = 0;
let fs = require('fs');
let socket = '/tmp/tester-server.socket';
let server = require('net').createServer();
if(fs.existsSync(socket)){fs.unlinkSync(socket);}
server.listen(socket);
server.on('connection',function onConnection(client){
client.on('data',function onData(data){count++;});
});;
setInterval(function countInterval(){
console.log(count);
count = 0;
},1000);
Sender code:
"use strict";
let client = require('net').createConnection('/tmp/tester-server.socket');
client.on('connect',function sendData(){
client.write('data');
setTimeout(sendData,0);
});
So I went beyond the standard Node.js modules and I am now trying out ws like below... same thing!.. over a port! Around 670 messages again! I'm going to try socket.io
next, but I'm placing bets it'll do the same. I'll also be picking into my host and my VM to make sure there is nothing in their environments that's causing this.
Receiver code:
"use strict";
let WebSocketServer = require('ws').Server;
let wss = new WebSocketServer({'port':20000});
let count = 0;
wss.on('connection',function(ws){
ws.on('message',function(){count++;});
});
setInterval(function(){
console.log(count);
count = 0;
},1000);
Sender code:
"use strict";
let WebSocket = require('ws');
let ws = new WebSocket('ws://localhost:20000');
ws.on('open',function open(){
ws.send('data');
setTimeout(open,0);
});
So socket.io didn't result any better, no more than about 450 messages per second. So I'll continue with the net module and try and find what in my system may be limiting Node.js and it's processes.
Receiver code:
"use strict";
let server
... keep reading on reddit β‘Hi, I hope this is the right place to ask this question.
I have an existing C++17 application that makes use of a number of standard threads. In particular one thread is an MQTT client - it subscribes to topics on a remote Broker and when another process somewhere publishes to a subscribed topic, a message is received by this thread. Now I want to forward this message to one of a number of threads in my application (perhaps based on the topic, or something in the message payload itself).
On the one hand I could just make each thread have its own dedicated MQTT client, with its own connection to the Broker, and it can subscribe just to the topics it cares about. I think this would work, but I'm not sure if it's the right approach, and it doubles up (or worse) on network resources when multiple threads want to subscribe to the same topic.
So I'm also considering an approach where I have a single MQTT client thread that subscribes on behalf of all the threads and dispatches incoming messages via some kind of internal messaging or mailbox system. Perhaps each thread has its own "receipt" queue (protected by locks etc) that the MQTT Client thread can push data into, and it registers itself during initialisation. I could probably design my own mechanism, but I am a little time-pressed, it's likely to be buggy for a long time, and I'd prefer to learn to use a decent open-source library instead.
I was looking at SObjectizer as a message box provider, and it seems well designed and the API is nice, but I'm not sure how to go about retro-fitting it into an existing application, since all my threads already exist and I don't really want to change them all into SO "Agents", and I also don't see how to integrate the Dispatcher. I think it's worth a look though, if anyone with experience can confirm it is appropriate.
Alternatively, are there any other libraries out there for robust messaging between multiple threads in a single application? Note that I don't need network or IPC support as all the threads are in the same process. Anything like this in Boost?
I'm also looking for any suggestions of what this kind of library might be called - what sort of terms should I be searching for? What is this kind of system called? Inter-thread Communication? Messaging System? In-process Pub/Sub? "Actor Concurrency" - is that the thing I am trying to do?
If it's of any interest, the MQTT Client I am using is [mqtt_cpp](https://g
... keep reading on reddit β‘Hi,
I have two standalone applications, one application is based on swing and the other application is an Eclipse-RCP-Application. Both applications use HTTP-Remoting to communicate with the same Wildfly 9-Servers. Now I need to link the two applications, because some defined actions in one client should trigger some actions in the other client. (Our customers work with two screens and have both applications open all the time. I know that sounds stupid, but that's none of my business).
Example: The swing client should switch to customer xyz if the user switches the customer in the Eclipse-Application. Other Example: Reload the customer data if the other client hits the save-button and updates the data in the database.
My boss suggested a communication through the wildfly (some kind of server-side (cached) action-queue which should be invoked periodically), but I think some kind of RMI-like technology would be a better choice.
Do you have any experiences in this area and what protocol/framework/technology would you recommend (and why)?
Cheers, Max
My question is strictly performance-wise. Firefox is a lot more responsive when using e10s. I used to think that IPC is slower than inter thread communication.
I see the point of separating into processes from a security point of view, I just don't understand why it is faster.
Servicelib is a library that simplifies the process of building persistent, stable Services, and helps you to access them directly from your Activities (and other Contexts).
Servicelib now supports inter-process communication. This means you can use it to communicate across app boundaries (ie. from Activity to a Service running in another app, or from Service to Service across process boundaries). Servicelib can establish a 2-way link so that you can send and receive messages between connected contexts.
Under the bonnet, Servicelib uses the Messenger class, and exposes Messages received back to you through a connection class (with accompanying listener).
Github link:
Tech blog on 'Clustering & Inter Process Communication (IPC) in NodeJS' https://manisuec.blog/2018/08/16/clustering-and-ipc-nodejs.html
Please provide your feedback/comments.
A little background, I have been developing a Xamarin forms app that collects EEG data continuously generated from a BCI (brain computer interface) cap as a user performs brain activity (left arm or right arm movement, a user imagines lifting a left dumbbell or right dumbbell). This EEG data is then continuously classified using an ML algorithm to produce a control signal of -1 to 1.
This control signal will then be used to control the left or right movement of a character in a Unity3d game. Now the problem is, since they are two different apps, I will need a way to send the classifer's output from Xamarin Forms app to Unity3d app. I was looking into Android background services in Xamarin but I'm not entirely sure if a background service is capable enough to send data to the Unity app continuously at the rate of 4-8 ms (the rate at which data is classified). Is background service a good idea or are there any alternative ways to achieve this?
The Xamarin Forms app does a lot more than just producing the control signal but in the worst case the only options is to re-create the Xamarin forms app from scratch in Unity so I don't have to handle the inter-process communication but again I don't think it's a good idea to use Unity for a non-game app dev.?
Any help or advice would be greatly appreciated. Thank you in advance!
EDIT: Sorry I didn't make it clear. Both the apps run on the same mobile device. I'm already using UDP and this will work if they are on two separate devices. But if they are on the same device, XF apps still need to continue running the classifier code and send the output to the unity game in a background service and I'm not sure if this is doable
Please note that this site uses cookies to personalise content and adverts, to provide social media features, and to analyse web traffic. Click here for more information.