message-passing

Is the MailboxProcessor type a replacement for locks?

I have been slowly examining all of the features that F# brings to the table. One that has particularly piqued my interest is the MailboxProcessor. The equivalent of this in C# would most likely use locks. Can we consider the MailboxProcessor as a replacement for locks? In the following example, am I doing anything particularly naive o...

PHP/Javascript passing message to another page

Hi.. So let me explain: I basically want so when you post a comment, (i use a js/jquery script to send string to insert.php which inserts to the database) you will receive 2+ points. Now i have done so you get +2 points, BUT i want to display a message like stackoverflow. I already know how to display a message like stackoverflow, but i...

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 have the following characteristics: No external setup required. I need to be able to get ev...

Has the `message-passing/shared-state' dilemma (concurrency & distribution) taken form of a `Holywar'?

I'm not too well-informed about the state of the discussion about which model is better, so I would like to ask a pretty straight question: Does it look like two opposing views having really heatened dispute? E.g. like prototype/class based OOP or dynamic vs. static typing (though these are really not much fitting examples, I just do...

Faking a Single Address Space

I have a large scientific computing task that parallelizes very well with SMP, but at too fine grained a level to be easily parallelized via explicit message passing. I'd like to parallelize it across address spaces and physical machines. Is it feasible to create a scheduler that would parallelize already multithreaded code across mult...

Canonical pattern reference in Actors programming model.

Hello! Is there a source, which I could use to learn some of the most used and popular practices regarding Actor-/Agent-oriented programming? My primary concern is about parallelism and distribution limited to the mentioned scheme - Actors, message passing. Should I begin with Erlang documentation or maybe there is any kind of book t...

Problem passing Data within Activity

Intent intent = new Intent(this,AnotherClass.class); intent.putExtra("Name", "foo"); setResult(RESULT_OK, null); super.onActivityResult(requestCode, resultCode, data); switch (requestCode) { case (1): { TextView textView = (TextView) findViewById(R.id.TextView01); if (resultCode == Activity.RESULT_OK) { ...

Parallelism in Python

What are the options for achieving parallelism in Python? I want to perform a bunch of CPU bound calculations over some very large rasters, and would like to parallelise them. Coming from a C background, I am familiar with three approaches to parallelism: Message passing processes, possibly distributed across a cluster, e.g. MPI. Exp...

How can I get around my "object reference" problem when passing messages to an actor?

A while back I put together a simple class named Actor that was my implementation of the Actor Model. Since then I've used it with great success (Minus some annoying workarounds for the lack of a discriminated union type.). I am left with an issue that I am unsure of how to resolve without making the class clunky and slow. When someone ...

Passing an identical message to multiple ObjC classes

I have multiple classes, all of which I want to send an identical message to. To be clearer: I want to send doX:withClass: with the same parameters to a number of classes. Perhaps code would make it clearer: + (void)doX:(NSString *)blah { [Utility doX:blah withClass:[Foo class]]; [Utility doX:blah withClass:[Bar class]]; ...

Zero-copy message-passing on the JVM

A faithful implementation of the actor message-passing semantics would mean that message contents are deep-copied from a logical point-of-view, even for immutable types. Deep-copying of message contents remains one the biggest bottlenecks for naïve implementations the actor model, so some implementations (ie. Kilim) support zero-copy mes...

Java: Is `while (true) { ... }` loop in a thread bad? What's the alternative?

Is while (true) { ... } loop in threads bad? What's the alternative? Update; what I'm trying to to... I have ~10,000 threads, each consuming messages from their private queues. I have one thread that's producing messages one by one and putting them in the correct consumer's queue. Each consumer thread loops indefinitely, checking for a...

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 ~10,000 consumers, each consuming messages from their private queues. I have one thread that'...

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 between "within node" and "between node" message passing? ...

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 model, so for performance some implementations support zero-copy message passing (although...

How should a chrome extension background page communicate with multiple content scripts?

I'm having trouble communicating with multiple content scripts from my background page. My background page has code like: chrome.tabs.sendRequest(tabId, { targetScript:"content1" }, function (resp) { if (resp.fromCorrectScript) { DoMoreStuff(); } }); and I have content scripts like: // content1.js chrome.extension.onRequest.a...

What is the difference between message-passing and method-invocation?

Is there a difference between message-passing and method-invocation, or can they be considered equivalent? This is probably specific to the language; many languages don't support message-passing (though all the ones I can think of support methods) and the ones that do can have entirely different implementations. Also, there are big diffe...

How is the Actor Model working compared to threads?

Is there any good and short explanation of how the Actor Model is working compared to threads? Can't a thread be seen as an actor and send messages to other threads? I see some difference, but it's not that clear for me. Can I use the Actor Model in any language by using threads differently? ...

Message passing nomenclature

Is there a reasonably accepted taxonomy for message passing methods? I think I've found a couple of different concepts with a somewhat confusing nomenclature (message queue, mailbox, channels, etc). I'd like to know if there is some reference (book for example) that I could refer to. ...

How to send and receive broadcast message

I am trying to pass data between two activities that are inside of tabs. I am trying to use the sendBroadcast. With breakpoints set I never reach the OnReceive. manifest : <activity android:name=".WebResults" android:label="@string/app_name"> <intent-filter> <action android:name="com.toxy.LOAD_URL" /> ...