On 13 feb 2012, at 07:49, Vasil Remeniuk <vasil.r...@gmail.com> wrote:
> Hello, Hakkers!
>
> I'm trying out Akka 2.0-M4 at one of my old Java projects.
> My aim is to run every actor an a dedicated thread, so that the thread
> is tied to actor's lifecycle (created, when the actor is started, and
> destroyed, when the actor is removed).
>
This is not strictly true even in 1.3, since the thread will be released after the shutdown-timeout (and recreated on demand).
That is not currently possible, because it is hard to imagine a valid use case for this kind of setup. What is the problem that this solves and which is not solvable otherwise?
Regards,
Roland Kuhn
Typesafe — The software stack for applications that scale
twitter: @rolandkuhn
Hi Roland,
>> This is not strictly true even in 1.3, since the thread will be released after the shutdown-timeout (and recreated on demand).
As far as I understand, from the documentation, dispatcher releases
the thread, only when the actor goes down (unregisters itself). I can
live with it :)
>> That is not currently possible, because it is hard to imagine a valid use case for this kind of setup. What is the problem that this solves and which is not solvable otherwise?
I'm trying to implement bots, for a quite sophisticated game server,
with actors. I don't quite understand (and don't actually want to :) )
all the chemistry that happens inside the server, but the server
doesn't allow bots/actors to share one thread.
In the legacy, bots were straighforwardly running on a dedicated
threads (new Thread(...).start()).
--
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To post to this group, send email to akka...@googlegroups.com.
To unsubscribe from this group, send email to akka-user+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/akka-user?hl=en.
>>I’m curious to know what the key features were of Akka which made you use it for this very peculiar project.
The problem with current implementation of bots is that once they are
started (vie new Thread(...).start()), you completely lose control
over them. I can certainly, manually add a queue/mailbox to every
thread, add my own message system, etc., to make bots more interactive
and controllable, but I'd prefer to use Akka API that I've got used
to :)
Thanks for your help! I think, I'll try to downgrade to 1.3.
--
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To post to this group, send email to akka...@googlegroups.com.
To unsubscribe from this group, send email to akka-user+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/akka-user?hl=en.
I print `Thread.currentThread().getName()` to the logs, when actor
processes the message, and always see the same thread name.
When I use another dispatcher (any event-based), thread names in the
log are different.
LOL. Running into Viktor can be a brutal reality check.
As the swedish saying goes: Viktor "släpper ingen jävel över bron".
--
Jonas Bonér
CTO
Typesafe - The software stack for applications that scale
Phone: +46 733 777 123
Twitter: @jboner
Aaah, stupid me. Please excuse me, guys -- thread IDs are indeed
different (one thread ID per actor).
Am Montag, 13. Februar 2012, 08:27:20 schrieb Roland Kuhn:
> Hi Vasil,
>
> On 13 feb 2012, at 07:49, Vasil Remeniuk <vasil.r...@gmail.com> wrote:
> > Hello, Hakkers!
> >
> > I'm trying out Akka 2.0-M4 at one of my old Java projects.
> > My aim is to run every actor an a dedicated thread, so that the thread
> > is tied to actor's lifecycle (created, when the actor is started, and
> > destroyed, when the actor is removed).
>
> This is not strictly true even in 1.3, since the thread will be released
> after the shutdown-timeout (and recreated on demand).
I'm currently struggling with this kind of thing as well. I spawn a "dedicated thread" worker to open a SWT session to do some "background" drawing which I do not want to execute on the GUI thread because it takes to much time to draw the image.
Akka works like a charm - appart from the issue that if the worker has nothing to do for an extended period of time it silently terminates its thread. When I stop the system the worker reawakes in postStop() to free its system resources - but sometimes on a different thread.
This causes SWT to complain because it cannot free its resources because SWT is always bound to exactly one thread (the one who called display.open()) and it does not support thread switching.
I was a little surprised by this because I thought that a "PinnedDispatcher" is exactly what I need. This causes me quite some headache as I didn't find a workaround yet.
And I think it qualifies as "use case" :-)
Greetings
Bernd
Am Montag, 13. Februar 2012, 08:27:20 schrieb Roland Kuhn:
> Hi Vasil,
>
> On 13 feb 2012, at 07:49, Vasil Remeniuk <vasil.r...@gmail.com> wrote:
> > Hello, Hakkers!
> >
> > I'm trying out Akka 2.0-M4 at one of my old Java projects.
> > My aim is to run every actor an a dedicated thread, so that the thread
> > is tied to actor's lifecycle (created, when the actor is started, and
> > destroyed, when the actor is removed).
>
> This is not strictly true even in 1.3, since the thread will be released
> after the shutdown-timeout (and recreated on demand).
I'm currently struggling with this kind of thing as well. I spawn a "dedicated thread" worker to open a SWT session to do some "background" drawing which I do not want to execute on the GUI thread because it takes to much time to draw the image.
Akka works like a charm - appart from the issue that if the worker has nothing to do for an extended period of time it silently terminates its thread. When I stop the system the worker reawakes in postStop() to free its system resources - but sometimes on a different thread.
This causes SWT to complain because it cannot free its resources because SWT is always bound to exactly one thread (the one who called display.open()) and it does not support thread switching.
I was a little surprised by this because I thought that a "PinnedDispatcher" is exactly what I need. This causes me quite some headache as I didn't find a workaround yet.
--
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To view this discussion on the web visit https://groups.google.com/d/msg/akka-user/-/s6xEqFPYOTIJ.
To post to this group, send email to akka...@googlegroups.com.
To unsubscribe from this group, send email to akka-user+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/akka-user?hl=en.
Roland Kuhn
Typesafe – The software stack for applications that scale.
twitter: @rolandkuhn
But doesn’t this mean that multiple actors using the same dispatcher-id will then share a thread?
But:uses configureExecutor()So if you just configure your thread-pool-executor section of the dispatcher, it should just work with PinnedDispatcher and turning off allowCorePoolTimeout?
Cheers,
√
To unsubscribe from this group, send email to akka-user+unsubscribe@googlegroups.com.
--
Viktor Klang
Akka Tech Lead
Roland Kuhn
Typesafe – The software stack for applications that scale.
twitter: @rolandkuhn
--
Viktor Klang
Akka Tech Lead
Am Samstag, 18. Februar 2012 14:31:57 UTC+1 schrieb Viktor Klang:But:uses configureExecutor()So if you just configure your thread-pool-executor section of the dispatcher, it should just work with PinnedDispatcher and turning off allowCorePoolTimeout?That property is unfortunately overridden here:
https://github.com/jboner/akka/blob/master/akka-actor/src/main/scala/akka/dispatch/PinnedDispatcher.scala#L28
so setting a large timeout is the only thing possible without subclassing.
To view this discussion on the web visit https://groups.google.com/d/msg/akka-user/-/QcdINYozTRYJ.
To unsubscribe from this group, send email to akka-user+...@googlegroups.com.
Am Samstag, 18. Februar 2012, 14:45:51 schrieb √iktor Ҡlang:
Hi Guys,
thanks for all the good hints, so I see I have hope to solve this (I am VERY new to akka - since M4 :-)
Greetings
Bernd
> On Sat, Feb 18, 2012 at 2:40 PM, rkuhn <goo...@rkuhn.info> wrote:
> > Am Samstag, 18. Februar 2012 14:31:57 UTC+1 schrieb Viktor Klang:
> >> But:
> >>
> >> https://github.com/jboner/**akka/blob/master/akka-actor/**
> >> src/main/scala/akka/dispatch/**Dispatchers.scala#L206<https://github.com
> >> /jboner/akka/blob/master/akka-actor/src/main/scala/akka/dispatch/Dispatc
> >> hers.scala#L206>
> >>
> >> uses configureExecutor()
> >>
> >> https://github.com/jboner/**akka/blob/master/akka-actor/**
> >> src/main/scala/akka/dispatch/**AbstractDispatcher.scala#L395<https://git
> >> hub.com/jboner/akka/blob/master/akka-actor/src/main/scala/akka/dispatch/
> >> AbstractDispatcher.scala#L395>
> >>>>> https://groups.google.com/d/*
> >>>>> *msg/akka-user/-/s6xEqFPYOTIJ<https://groups.google.com/d/msg/akka-u
> >>>>> ser/-/s6xEqFPYOTIJ> .
> >>>>>
> >>>>> To post to this group, send email to akka...@googlegroups.com.
> >>>>> To unsubscribe from this group, send email to
> >>>>> akka-user+unsubscribe@** googlegroups.com
> >>>>> <akka-user%2Bunsu...@googlegroups.com>. For more options, visit
> >>>>> this group at http://groups.google.com/** group/akka-user?hl=en
> >>>>> <http://groups.google.com/group/akka-user?hl=en> .
> >>>>
> >>>> --
> >>>> Viktor Klang
> >>>>
> >>>> Akka Tech Lead
> >>>> Typesafe <http://www.typesafe.com/> - The software stack for
> >>>> applications that scale
> >>>>
> >>>> Twitter: @viktorklang
> >>>>
> >>>> Roland Kuhn
> >>>>
> >>>> Typesafe <http://typesafe.com/> – The software stack for applications
> >>>> that scale.
> >>>> twitter: @rolandkuhn <http://twitter.com/#%21/rolandkuhn>
> >>>
> >>> --
> >>> Viktor Klang
> >>>
> >>> Akka Tech Lead
> >>> Typesafe <http://www.typesafe.com/> - The software stack for
> >>> applications that scale
> >>>
> >>> Twitter: @viktorklang
> >>
> >> --
> >> Viktor Klang
> >>
> >> Akka Tech Lead
> >> Typesafe <http://www.typesafe.com/> - The software stack for