Questions tagged [message-passing]

Message passing is a data transfer mechanism that is used in various forms in a number of programming languages

The basic form of data transfer in programming languages is the assignment statement. It is carried out by a (computing) agent that moves data from one part of the memory to another. The substantial difference between assignment and message passing is that message passing incorporates two active agents, a sender and a receiver. The sender has exclusive control over the source locations of the data to be transferred, while the receiver has exclusive control over the destination of the data.

Message passing can be classified by a number of criteria, the most important of which is

  • Mode of operation:

    • Synchronous (also called rendezvous or handshaking): Sender and receiver perform their transfer operations simultaneously. They may have to wait before transfer becomes possible.
    • Asynchronous: Sender is allowed to transfer data to a temporary location where it can be accessed by the receiver. Sender does not have to wait if temporary storage is available.
  • Addressing:

    • Direct: Sender and receiver refer to each other directly, by using unique IDs.
    • Indirect: There is an auxiliary object (channel) that connects the sender and the receiver, who only refer to the channel during message passing.
409 questions
18
votes
8 answers

How do I send a string from one instance of my Delphi program to another?

What is the best and easiest way to send a string from one instance of my program to another instance of my program? The receiving program has to execute a procedure, using the received string as a parameter. I started reading about DDE but I got…
Arthur
  • 3,376
  • 11
  • 43
  • 70
16
votes
2 answers

Method delegation in python

I'm writing a small framework for orchestrating AWS clusters and there are some common hierarchical patterns that appear over and over again. One such pattern is gathering a collection of instances into a bigger object and then delegating some…
David K.
  • 6,153
  • 10
  • 47
  • 78
15
votes
1 answer

What is the difference between processes/messages in Erlang and objects/messages in Smalltalk?

I'm trying to understand difference between objects/messages in Smalltalk and processes/messages in Erlang. I read the following post on the topic. As far as I understand, in Smalltalk, everything is an object, and everything has the same…
14
votes
3 answers

Web Workers communication using MessageChannel HTML5

I would like to implement communication between webworkers. I read the W3C documentation and I found MessageChannel is one of the ways to do it, but while reading MessageChannel I couldn't understand how to implement communication between workers…
kongaraju
  • 9,344
  • 11
  • 55
  • 78
13
votes
3 answers

Implementing a Sticky Service in android/flutter

I need to add a native sticky background service in a flutter application, in order to achieve 2 things: Starting at boot time and running in background indefinitely Exchange data with the main Dart activity, in a message passing fashion However,…
docdev
  • 943
  • 1
  • 7
  • 17
13
votes
3 answers

Akka Pattern - Actor tree, reply to original source

This is a design question; Say I have a tree of actors which do a bunch of processing. The processing is kicked off by a client/connection actor (i.e. the tree is the server). Eventually the client actor wants a response. I.e. I have an actor…
NightWolf
  • 7,694
  • 9
  • 74
  • 121
13
votes
2 answers

Message Queue vs. Message passing

I saw here (Wikipedia article about IPC) that these are two separate things, but even reading each one's dedicated Wikipedia page I didn't understand what the difference is. Can someone explain this simply?
Baruch
  • 20,590
  • 28
  • 126
  • 201
12
votes
1 answer

Understanding the point of supply blocks (on-demand supplies)

I'm having trouble getting my head around the purpose of supply {…} blocks/the on-demand supplies that they create. Live supplies (that is, the types that come from a Supplier and get new values whenever that Supplier emits a value) make sense to me…
codesections
  • 8,900
  • 16
  • 50
12
votes
2 answers

How do I pass back data from a remote window to a chrome extension's background page?

I have a chrome extension, and from my background page I open a remote window: chrome.windows.create({ type : 'popup', url : "https://www.example.com/mypage.html" }, function(newWindow) { }); On my remote page…
abinop
  • 3,153
  • 5
  • 32
  • 46
11
votes
4 answers

Does Erlang always copy messages between processes on the same node?

A faithful implementation of the actor message-passing semantics means that message contents are deep-copied from a logical point-of-view, even for immutable types. Deep-copying of message contents remains a bottleneck for implementations the actor…
Mr. X
  • 111
  • 1
  • 3
11
votes
3 answers

What library can I use to do simple, lightweight message passing?

I will be starting a project which requires communication between distributed nodes(the project is in C++). I need a lightweight message passing library to pass very simple messages(basically just strings of text) between nodes. The library must…
Mike
  • 23,892
  • 18
  • 70
  • 90
11
votes
1 answer

what does it mean configuring MPI for shared memory?

I have a bit of research related question. Currently I have finished implementation of structure skeleton frame work based on MPI (specifically using openmpi 6.3). the frame work is supposed to be used on single machine. now, I am comparing it with…
LeTex
  • 1,452
  • 1
  • 14
  • 28
10
votes
1 answer

Checking if a react block is ready for business

When writing concurrent code, it's fairly common to want to spin off a separate (green or OS) thread and then ask the code in that thread to react to various thread-safe messages. Raku supports this pattern in a number of ways. For example, many of…
codesections
  • 8,900
  • 16
  • 50
10
votes
2 answers

How does Erlang pass messages between processes on the same node?

Between nodes, message are (must be) passed over TCP/IP. However, by what mechanism are they passed between processes running on the same node? Is TCP/IP used in this case as well? Unix domain sockets? What is the difference in performance…
mjs
  • 63,493
  • 27
  • 91
  • 122
10
votes
2 answers

How is barrier implemented in message passing systems?

What I understand is, that one master process sends a message to all other processes. All the other processes in return send a message to the master process. Would this be enough for a barrier to work? If not, then what more is needed?
MetallicPriest
  • 29,191
  • 52
  • 200
  • 356
1
2
3
27 28