- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
Beginning with Actors.
Deear all,
I need to use actors in the Java "Callable" way...meaning I have to submit two independent computations in Parallel....and synchronize on the completion or the timeout of the two operations...
Can you point me to a resource where I can see how to implement this with actors?
Thank you very much
Best Regards
Edmondo
I need to use actors in the Java "Callable" way...meaning I have to submit two independent computations in Parallel....and synchronize on the completion or the timeout of the two operations...
Can you point me to a resource where I can see how to implement this with actors?
Thank you very much
Best Regards
Edmondo










Re: Beginning with Actors.
On Wed, Jan 18, 2012 at 1:37 AM, Edmondo Porcu <edmondo [dot] porcu [at] gmail [dot] com> wrote:
Re: Beginning with Actors.
On Wed, Jan 18, 2012 at 10:04 AM, Naftoli Gugenheim <naftoligug [at] gmail [dot] com> wrote:
I'd suggest using Future composition instead.
No.
--
Viktor Klang
Akka Tech LeadTypesafe - The software stack for applications that scale
Twitter: @viktorklang
Re: Beginning with Actors.
2012/1/18 √iktor Ҡlang <viktor [dot] klang [at] gmail [dot] com>
Re: Beginning with Actors.
2012/1/18 Edmondo Porcu <edmondo [dot] porcu [at] gmail [dot] com>
*sprinkles details*
I'll gladly answer questions, but be a bit more specific please.
Cheers,
√
--
Viktor Klang
Akka Tech LeadTypesafe - The software stack for applications that scale
Twitter: @viktorklang
Re: Beginning with Actors.
Edmondo
If you're looking for a general introduction and explanation of
concepts, the Artima Actors in Scala book is a good starting point
2012/1/18 √iktor Ҡlang :
>
>
> 2012/1/18 Edmondo Porcu
>>
>> Would be great if you could provide a little bit more details...Thank you
>
>
> *sprinkles details*
>
> I'll gladly answer questions, but be a bit more specific please.
>
> Cheers,
> √
>
>>
>> Best Regards
>>
>>
>> 2012/1/18 √iktor Ҡlang
>>>
>>>
>>>
>>> On Wed, Jan 18, 2012 at 10:04 AM, Naftoli Gugenheim
>>> wrote:
>>>>
>>>> If it needs to execute in parallel then why use actors and not regular
>>>> Executors?
>>>
>>>
>>> I'd suggest using Future composition instead.
>>>
>>>>
>>>> The actor model is specifically designed for serial execution.
>>>
>>>
>>> No.
>>>
>>>>
>>>>
>>>>
>>>> On Wed, Jan 18, 2012 at 1:37 AM, Edmondo Porcu
>>>> wrote:
>>>>>
>>>>> Deear all,
>>>>> I need to use actors in the Java "Callable" way...meaning I have to
>>>>> submit two independent computations in Parallel....and synchronize on the
>>>>> completion or the timeout of the two operations...
>>>>>
>>>>> Can you point me to a resource where I can see how to implement this
>>>>> with actors?
>>>>>
>>>>> Thank you very much
>>>>>
>>>>> Best Regards
>>>>>
>>>>> Edmondo
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> Viktor Klang
>>>
>>> Akka Tech Lead
>>> Typesafe - The software stack for applications that scale
>>>
>>> Twitter: @viktorklang
>>>
>>
>
>
>
> --
> Viktor Klang
>
> Akka Tech Lead
> Typesafe - The software stack for applications that scale
>
> Twitter: @viktorklang
>
Re: Beginning with Actors.
Let me rephrase my questions in a different way:
1) Viktor, what you do suggest is to create for example a class containing a given number of futures and collect their resuls. I know how to do it through a synchronizer, using for example a CountDownLatch . I guess there is a better solution in Java to launch a given number of parallel processing and collect their results.
2) Tim, Actors in Scala is definitely on my list. I am only slightly confused on these two points:
- Actors simplify the execution of parallel, interdependent tasks because they replace shared data structures with immutable message passing. Is there a reason to prefer actors to java executors when the tasks are independent?
- I have read that scala.Actors will be dropped in Scala 2.10 and only Akka actors will be included. What is the difference between them?
Thank you as usualBest Regards
Edmondo Porcu
2012/1/18 Tim Pigden <tim [dot] pigden [at] optrak [dot] com>
Re: Beginning with Actors.
Of course, scala.actors will go through the regular deprecation cycle first, so they will definitely be included in Scala 2.10.
Some features that currently only Akka actors have will be added to scala.actors to make the migration easier. One example is ActorRefs that Viktor mentioned. In general, we are working on migration support for transitioning from scala.actors to Akka actors. More details should soon be available.
Otherwise, the book "Actors in Scala" also has a chapter on Akka actors, so it provides an introduction to both implementations.
Cheers, Philipp
-- Co-author, "Actors in Scala" (Artima Inc, 2011) Postdoc, EPFL and Stanford University
Re: Beginning with Actors.
1 Fork / Join
2 Scala parallel collection
On Wednesday, January 18, 2012 6:36:21 PM UTC+8, edmondo1984 wrote:
Re: Beginning with Actors.
On Wed, Jan 18, 2012 at 11:36 AM, Edmondo Porcu <edmondo [dot] porcu [at] gmail [dot] com> wrote:
http://akka.io/docs/akka/2.0-M2/scala/futures.html#composing-futures
Depends on how you want to handle the results of the tasks. Also, I'm assuming you meant "independent" and not "interdependent".
Everything except the foundation, which is the Actor Model.
Cheers,
√
--
Viktor Klang
Akka Tech LeadTypesafe - The software stack for applications that scale
Twitter: @viktorklang
Re: Beginning with Actors.
2012/1/18 √iktor Ҡlang <viktor [dot] klang [at] gmail [dot] com>
But the main features of Akka, which Scala Actors doesn't have is:
* ActorRefs
* High performance
* Hierarchical enforced parental supervision
--
Viktor Klang
Akka Tech LeadTypesafe - The software stack for applications that scale
Twitter: @viktorklang
Re: Beginning with Actors.
Best Regards
2012/1/18 Naftoli Gugenheim <naftoligug [at] gmail [dot] com>
Re: Beginning with Actors.
val me = selfreactor { val result = ... me ! result}
reactor { val result = ... me ! result}
val result1 = receive { case x => x}
val result2 = receive { case x => x}
R: Re: Beginning with Actors.
I heard scala actors will be replaced by akka actors... Should I already code using akka actors instead?? How is the thread pool backing the actors in the example managed?
Best regards
EdmondoInviato da BlackBerry(R) Wireless HandheldFrom: IL <iron9light [at] gmail [dot] com> Sender: scala-user [at] googlegroups [dot] com Date: Tue, 17 Jan 2012 22:51:09 -0800 (PST)To: <scala-user [at] googlegroups [dot] com>ReplyTo: scala-user [at] googlegroups [dot] com Subject: [scala-user] Re: Beginning with Actors.
import scala.actors.Actor._
val me = selfreactor { val result = ... me ! result}
reactor { val result = ... me ! result}
val result1 = receive { case x => x}
val result2 = receive { case x => x}