Actors, Green Threads and CSP on the JVM
boundary.com
Actors, Green Threads and CSP on the JVM
1–10 of 49 posts
Re: Actors, Green Threads and CSP on the JVM
#2Re: Actors, Green Threads and CSP on the JVM
#3That's not really the issue as far as I'm concerned. Message-passing concurrency actually allows people be productive writing concurrent code that has a hope of working -- that is the main advantage. Occasionally things go wrong. Occasionally you need more performance and have to drop down to a lower level. But I can easily write a web service running on the JVM that gets 1000 requests/s per CPU with a bit of message passing concurrency. That's the point.
Heck, I don't even like the actor model -- I much prefer CSP -- but I'd attack it for other reasons (like lack of type safety).
Re: Actors, Green Threads and CSP on the JVM
#4Very interesting article and analysis, although it would be nice if it explained what exactly a "Green Thread" is. From the article, I am guessing that a "Green Thread" is related to the lightweight low-level concurrency mechanism that he is referring to as the alternative to normal threads, but it is not exactly clear what that really means.
- you have to balance load across true OS threads to take advantage of multiple CPUs. (You often pin an OS thread per CPU.)
- if you make a call to a blocking OS function you have no way to pre-empt your lightweight thread.
HTH.
Update: "you have to balance load" --> I mean the green thread library implementer. Users of a lightweight threading library typically don't concern themselves with this, though they might if performance becomes an issue.
Re: Actors, Green Threads and CSP on the JVM
#5Re: Actors, Green Threads and CSP on the JVM
#6I use Akka Scala/Java JVM actor framework daily, and it manages to get by without bytecode weaving. The lack of type safety is irritating, though.
Re: Actors, Green Threads and CSP on the JVM
#7Re: Actors, Green Threads and CSP on the JVM
#8Anyone using core.async knows how this article relates to it?
Re: Actors, Green Threads and CSP on the JVM
#9Re: Actors, Green Threads and CSP on the JVM
#10The argument seems to be that the actor model implementations on the JVM aren't all that fast and the language can't stop you from shooting yourself in the foot. That's not really the issue as far as I'm concerned. Message-passing concurrency actually allows people be productive writing concurrent code that has a hope of working -- that is the main advantage. Occasionally things go wrong. Occasionally you need more p…
The issue isn't actor model on a virtual machine-- erlang runs on a VM-- the issue is that the actor model is insufficient. You need pretty much most of OTP to build reliable, stable, concurrent systems.
This is why goroutines, everything on the JVM, etc are not going to work.
The sad thing is, I think the primary reason people are not using Erlang is they are afraid of the syntax, but even that reason is obliterated by the existence of Elixir (an even better language on the erlang VM)