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
9
votes
5 answers

Message passing vs locking

What exactly is the difference between message passing concurrency schemes and lock-based concurrency schemes, in terms of performance? A thread that is waiting on a lock blocks, so other threads can run. As a result, I don't see how message-passing…
Puppy
  • 144,682
  • 38
  • 256
  • 465
9
votes
1 answer

chrome extension to Send Message from popup to content script

I,am developing an extension in which i have to extract data from linkedin profile page when user press button on popup. I,am passing message from the popup.js page to contentscript and in response i will get data extracted from linkedin profile…
9
votes
4 answers

What makes Erlang suitable for soft real-time applications?

Some background I'm working on building a programming language for digital media programming, which should support concurrency using no-sharing message passing and soft real-time (i.e. do your best to compute audio/video without losing samples or…
Carl Seleborg
  • 13,125
  • 11
  • 58
  • 70
8
votes
4 answers

C#/.Net equivalent of NSNotification

I'm an Objective-C developer porting an application to the .Net world. In my Obj-C application, I use NSNotification objects to communicate asynchronously between a handful of objects. Is there some way to do something similar in the .Net world…
cjkarr
  • 83
  • 1
  • 3
8
votes
1 answer

What does `Fatal Python error: PyThreadState_Get: no current thread` mean?

I am passing an mpi communicator from python to C. I chose to use boost's mpi communicator as mpi4py does not seem to have good C support. Check it out: try: from boost.mpi import world except ImportError: from mpi import world …
kilojoules
  • 9,768
  • 18
  • 77
  • 149
8
votes
5 answers

Objective-C "messages" - what's the right way to read it?

You can declare a method in objective-c and name each parameter twice, basically. I get the idea that this is powerful, but I'm not quite sure how to use it yet... When John Greets Kelly: [ p Greet:"John" toPerson:"Kelly" greetWith:"hey babe" ]…
bobobobo
  • 64,917
  • 62
  • 258
  • 363
7
votes
3 answers

OCaml event/channel tutorial?

I'm in OCaml. I'm looking to simulate communicating nodes to look at how quickly messages propagate under different communication schemes etc. The nodes can 1. send and 2. receive a fixed message. I guess the obvious thing to do is have each node as…
R u c k s a c k
  • 784
  • 6
  • 17
7
votes
2 answers

Choosing a consistency model for a concurrent programming language

I am in the design phase of a programming language, currently thinking about the concurrency aspects. I need to figure out a consistency model, i.e. how data is handled by concurrent processes programmed in this language. There are two important…
7
votes
0 answers

High CPU usage when using pebbe zmq proxy at high message rates

I am currently experimenting with ZMQ as a possible message broker for IPCs. Version -> ZMQv4 I am using pebbe ZMQ , a go library over zmq's C library and performing tests. I am rate testing it with a message rate of 1500 messages/sec and 10000…
7
votes
2 answers

Is it possible to send a message to all child processes in elixir/erlang?

Let's imagine that I'm spawning multiple child processes in elixir. defmodule Child do def start(name) do receive do msg -> IO.puts "Message received by #{name}: #{inspect msg}" end end end defmodule Parent do def main do …
limp_chimp
  • 13,475
  • 17
  • 66
  • 105
7
votes
2 answers

How do I find out the path of the file triggered by opening a file with a custom file extension?

How do i get the location of the file that i used to open my programs with? Example: if i create a new extention ".xyz" say and i tell windows that i want to open the file type .xyz with myapplication, then it starts my aplication. Great, but how…
Arthur
  • 3,376
  • 11
  • 43
  • 70
7
votes
4 answers

Node.Js in Erlang style?

I am a complete noob when it comes to both Node.Js and Erlang. But wouldn't it be possible to build a Node.js app that emulates Erlang behavior? e.g. you pass json messages across an distributed node.js server park and even pass new code to those…
Roger Johansson
  • 22,764
  • 18
  • 97
  • 193
7
votes
1 answer

What is the most secure way of passing messages between an injected script and Google Chrome extension code/content script?

Definitions: Please note from the outset that by 'injected script', 'extension code' and 'content script' I will be using the definitions provided in the excellent first answer to this question. Assumption: Handling confidential information is…
7
votes
5 answers

Java: High-performance message-passing (single-producer/single-consumer)

I initially asked this question here, but I've realized that my question is not about a while-true loop. What I want to know is, what's the proper way to do high-performance asynchronous message-passing in Java? What I'm trying to do... I have…
Mr. Burgundy
  • 351
  • 1
  • 4
  • 5
7
votes
2 answers

Ok to call MPI_Isend multiple times on one buffer?

Regarding MPI_Isend, the MPI standard says "A nonblocking send call indicates that the system may start copying data out of the send buffer. The sender should not access any part of the send buffer after a nonblocking send operation is called, until…
Posco Grubb
  • 522
  • 2
  • 7
  • 20
1 2
3
27 28