This page is no longer maintained — Please continue to the home page at www.scala-lang.org

Actor support for SEDA?

No replies
pmonks
Joined: 2009-06-03,
User offline. Last seen 42 years 45 weeks ago.

G'day everyone,

I've seen SEDA [1] mentioned once or twice [2] already in the context of
actors, but was wondering what the latest thinking was?

To learn Scala, I'm considering porting a little Java app that uses a SEDA
architecture to Scala, and am not sure if/how I might leverage actors.
Basically it's a batch application that processes a reasonably large amount
of data, and I've broken that processing down into various stages that are
quite independent of one another and vary between being I/O bound (both
network and disk) and CPU bound.

In the Java app, each stage has a single queue feeding a dedicated thread
pool, and each thread pool is sized to try to maximise usage of all three
resources (disk, network and CPU). The logic running on each thread within a
stage is identical, and there's a clean hand-off between each stage that
ensures there's no shared mutable state (either within a single stage or
between multiple stages).

Are actors suitable for this kind of thing? Are they re-entrant (so I only
need one actor per stage, potentially running concurrently with itself) and
can I instantiate multiple actors and hook them all up to a single message
queue (so that producers are decoupled from specific actor instances)? Is
there a different approach that better maps to actor based concurrency?

Apologies in advance if this has been asked before or is a n00b question - I
am new to Scala.

Cheers,
Peter

[1] http://www.eecs.harvard.edu/~mdw/papers/seda-sosp01.pdf
http://www.eecs.harvard.edu/~mdw/papers/seda-sosp01.pdf
[2] http://www.nabble.com/forum/Search.jtp?query=seda&local=y&forum=14147
http://www.nabble.com/forum/Search.jtp?query=seda&local=y&forum=14147

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland