actors

Message Passing Concurrency Library for C?

I've been looking around, but I can't seem to find a message-passing concurrency (Actor) library for C (not C++). Ideally the candidate would be based on something like libevent underneath allowing for non-blocking I/O in most places. Does anyone know of such a library? ...

Use case relationship with actor

if A is extension use case (not base use case), can A be directly referenced by the actor? ...

Unit testing scala actors

Anyone know of a good way to unit test Scala actors? In the general sense I have an actor that receives a message and will send out other messages in response. This is done on multiple threads, and an actor that is not correct may either send the wrong messages or no message at all. I need a simple way of creating a mockup actor that sen...

Scala remote actors

Are there any guides or tutorials which explain the possibility to use scala actors remotely? All I have found until now is one example (without comments) but that's hardly enough. ...

Design patterns for Agent / Actor based concurrent design.

Recently i have been getting into alternative languages that support an actor/agent/shared nothing architecture - ie. scala, clojure etc (clojure also supports shared state). So far most of the documentation that I have read focus around the intro level. What I am looking for is more advanced documentation along the gang of four but in...

how to do actors (erlang) in java?

I work on financial applications in Java and getting concurrency right is pain. Erlang and the actors model is supposed to be a good fit for massively concurrent applications but I can't figure out how to do it in Java. I know there are libraries such as Jetlang, FunctionalJava, kilim, etc., but they don't usually go beyond simplistic ...

What does a single apostrophe mean in Scala?

In this slide show on ScalaActors.pdf what does the single quote indicate when the message is sent to the pong actor? class Ping(count: int, pong: Pong) extends Actor { def act() { pong ! 'Ping // what does the single quote indicate??? receive { case 'Pong => } } } ...

Does this Scala actor block when creating new actor in a handler?

I have the following piece of code: actor { loop { react { case SomeEvent => //I want to submit a piece of work to a queue and then send a response //when that is finished. However, I don't want *this* actor to block val params = "Some args" val f: Future[Any] = myQueue.submitWork( para...

Migrating from Java concurrency to Scala concurrency

I have a fairly standard mechanism in Java for solving the problem: Work items must be scheduled to execute at a particular time Each work item must then wait on a condition becoming true Work items should be cancellable The solution I use is as follows: Have a single-threaded scheduler to schedule my work items Have an ExecutorSe...

How does Erlang's support for *transparent* distribution of actors impact application design?

One of the features of the actor model in Erlang is transparent distribution. Unless I'm misinterpreting, when you send messages between actors, you theoretically shouldn't assume that they are in the same process space or even co-located on the same physical machine. I've always been under the impression that distributed, fault tole...

Actor Model advantages to shared state

I'm reading about the Actor Model for a presentation and everyone claimes that it is superior to shared state parallel programming because it avoids many pitfalls like deadlocks and race conditions. I'm asking myself what the specifics of this claims are. If it avoids these problems, how does it do it? ...

Scala actors as single-threaded queues

I'd like to use actors in a program where I'll have some kind of restriction around treating some of the actors as if they were queues. For example, suppose I have some external system to which change events are applied and also some cache of the external system's data. So I have 2 actors: ChangeApplicationActor CacheActor As part of...

Can Scala actors process multiple messages simultaneously?

The reply to a recent question of mine indicated that an actor processed its messages one at a time. Is this true? I see nothing that explicitly says that (in Programming in Scala), which contains the following snippet (pp. 593) If [the react method] finds a message that can be handled, [it] will schedule the handling of that message...

Processing concurrently in Scala

As in my own answer to my own question, I have the situation whereby I am processing a large number of events which arrive on a queue. Each event is handled in exactly the same manner and each even can be handled independently of all other events. My program takes advantage of the Scala concurrency framework and many of the processes i...

Can Scala's Actor framework handle 10.000 actors without stack problems?

I want to do a multi-agent simulation containing about 10.000 agents (machine and product agents) using the Scala Actor framework. As I understand, if there are lots of actors passing messages around, can it run out of stack due the recursion? If so, how can I increase the stack sizes for the underlying worker threads? ...

Should my Scala actors' properties be marked @volatile?

In Scala, if I have a simple class as follows: val calc = actor { var sum = 0 loop { react { case Add(n) => sum += n case RequestSum => sender ! sum } } } Should my field sum be marked @volatile? Whilst the actor is logically single-threaded (i.e. the messages are processed sequentially), the...

Howto design a clock driven multi-agent simulation

I want to create a multi-agent simulation model for a real word manufacturing process to evaluate some dispatching rules. The simulation needs to produce event logs to evaluate time effect of the dispatching rules compared to the real manufacturing event logs. How can I incorporate the 'current simulation time' into this kind of multi-a...

Is it bad practice to send an actor a message from something which is not an actor?

Suppose I have some class which has a property actor_ of type Actor. Is there a problem with me doing def someMethod() = { actor_ ! "HELLO" } Or should sending a message always be done from another actor; e.g. def someMethod() = { Actor.actor { actor_ ! "HELLO" } } ...

How can I identify a remote actor?

I have a remote actor (client) which is registering with another remote actor (server) and then later deregistering (with a shutdown hook). However, although the server picks up the de-registration, the actual sender property is a different Channel object; so in my server logs I have: Registered new client [scala.actors.Channel@158e2...

What does the remote-actor framework do if trying to write to a client which is no longer there?

I have a server which is using the remote actors framework to communicate with multiple clients. As mentioned in this question, I am having trouble keeping track of when a client disappears. Hence my server is still attempting to send messages to non-existent clients. Is this a problem? (I don't see any exceptions being thrown - but I ...