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
6
votes
1 answer

Are seda and the actor model essentially equivalent?

SEDA is essentially a set of independent "services" that communicate with each other via queues, which could further be abstracted as message passing. The actor model is a set of independent functions, which communicate with each other through…
Jonathan Winks
  • 1,091
  • 2
  • 9
  • 12
6
votes
1 answer

Why didn't x86 implement direct core-to-core messaging assembly/cpu instructions?

After serious development, CPUs gained many cores, gained distributed blocks of cores on multiple chiplets, numa systems, etc but still a piece of data has to pass through not only L1 cache (if on same core SMT) but also some atomic/mutex…
6
votes
1 answer

In MPI_Gather(), MPI_Scatter() what is the difference between send count and receive count?

In MPI gather and scatter there is two counts for send and receive. I checked the docs and found out that both should have the same value. Ex:- In MPI_Gather() both send_count and receive_count should have the size of the send buffer size.…
Janaka Chathuranga
  • 1,742
  • 16
  • 19
6
votes
6 answers

When is messaging (e.g. JMS) an alternative for multithreading?

I work on a data processing application in which concurrency is achieved by putting several units of work on a message queue that multiple instances of a message driven bean (MDB) listen to. Other than achieving concurrency in this manner, we do not…
Rahul
  • 12,886
  • 13
  • 57
  • 62
6
votes
3 answers

OOP - Message Passing in C#

What is the example of the OOP concept 'Message Passing' in C# (calling methods/Passing parameters/Firing Events/Handling Events/???) and why is it called message passing?
user366312
  • 16,949
  • 65
  • 235
  • 452
6
votes
2 answers

In Akka, how do I know when an actor is ready to use after having been registered with actorOf()?

If I create an actor using context().actorOf() in Akka, I get back a valid ActorRef. However, if I do the same but create an ActorRef using actorFor and the path I know that the actor will appear at, I do not reliably get a valid ActorRef back. How…
SoftMemes
  • 5,602
  • 4
  • 32
  • 61
5
votes
1 answer

How to implement message passing in Firefox extension?

I have a file which overwrites overlay.xul that overwrites browser.xul. I want to implement message passing in a similar way as implemented in chrome extensions. chrome.manifest- content helloworld content/ overlay…
Ankit
  • 51
  • 3
5
votes
1 answer

Use an OS process like a bash pipe: Send it STDIN and get its STDOUT

I'm trying to use an external process which reads the STDIN, and writes to STDOUT. I want to write the equivalent of this in Elixir, without using an external library or wrapper script: $ echo foo | nkf foo i.e. send data to nkf on stdin, and get…
Adam Millerchip
  • 20,844
  • 5
  • 51
  • 74
5
votes
4 answers

MPI_Bcast: Efficiency advantages?

In MPI, is MPI_Bcast purely a convenience function or is there an efficiency advantage to using it instead of just looping over all ranks and sending the same message to all of them? Rationale: MPI_Bcast's behavior of sending the message to…
dsimcha
  • 67,514
  • 53
  • 213
  • 334
5
votes
1 answer

How to modify MPI blocking send and receive to non-blocking

I am trying to understand the difference between blocking and non-blocking message passing mechanisms in parallel processing using MPI. Suppose we have the following blocking code: #include #include #include "mpi.h" int main…
Mike H.
  • 51
  • 4
5
votes
2 answers

Is it possible to send a message to an unregistered processes in Erlang?

I am aware that you can preform simple message passing with the following: self() ! hello. and you can see the message by calling: flush(). I can also create simple processes in functions with something like: spawn(module, function,…
Opentuned
  • 1,477
  • 17
  • 21
5
votes
1 answer

chrome.tabs.sendMessage callback function is not called. Why?

I have the following method that is called from the background script of my Chrome Extension. The goal is to send a message to a specific tab and then call provided callback method with the result. The important part is that the callbackDone must be…
c00000fd
  • 20,994
  • 29
  • 177
  • 400
5
votes
3 answers

TPL Dataflow, can I query whether a data block is marked complete but has not yet completed?

Given the following: BufferBlock sourceBlock = new BufferBlock(); TransformBlock targetBlock = new TransformBlock(element => { return element * 2; }); sourceBlock.LinkTo(targetBlock, new DataflowLinkOptions {…
Matt
  • 7,004
  • 11
  • 71
  • 117
5
votes
1 answer

Empty Process Mail box in Erlang

when you send a message to the shell process, you can flush all messages out by calling: c:flush(). C:\Windows\System32>erl Eshell V5.9 (abort with ^G) 1> self() ! josh. josh 2> self() ! me. me 3> self() ! you. you 4> flush(). Shell got josh Shell…
Muzaaya Joshua
  • 7,736
  • 3
  • 47
  • 86
4
votes
2 answers

Chrome Extension: Message passing confusion

I'm trying to send the number of checked items on a page over to a popup. The add input button on the popup alerts or sends to the console the amount of checkboxes checked on the webpage. My script is not doing this and I thought there may be a…