Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I'm doing some early-stage research towards architecting a new software application. Concurrency and multithreading will likely play a significant part, so I've been reading up on the various topics.

The producer-consumer model, at least how it is expressed in Java, has some surface similarities but appears to be deeply dissimilar to the actor model in use with languages such as Erlang and Scala. I'm having trouble finding any good comparative data, or specific reasons to use or avoid the one or the other.

Is the actor model even possible with Java or C#, or do you have do use one of the languages built for the purpose? Is there a third way?

share|improve this question
    

2 Answers 2

up vote 0 down vote accepted

Sure, you could implement an actor-based model in both java and C#. Infact microsoft already did so. You gain a bunch of benefits though if the model is an abstraction directly in the language.

That being said the jury is still out on whether the actor-model will be the concurrency model of the future. Clojure goes with software transactional memory as it's underlying concurrency model.

Personally I think neither the actor model nor STM will end up being the de-facto concurrency model but rather an OOP/functional hybrid programming language with concurrency abstractions built directly into the language.

share|improve this answer
    
Such as Asynchronous Agents Library. –  rwong Jun 5 '11 at 0:43
    
Could you expand on that last point a little? –  hewhocutsdown Jun 6 '11 at 13:21
2  
Mind you, the actor abstraction is not part of the Scala language. It is, in fact, one of the best examples of Scala making it possible for libraries to rival built-in features. –  Daniel C. Sobral Jun 6 '11 at 16:35

If you would like to try out the actor model in Java (and Scala) you might want to take a look at Akka. Libraries are also being developed for C++ (see the libraries listed on this wikipedia page).

So, it seems that the actor model need not be built-in in the programming language.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.