Fiber as a scheduled executor

47 zobrazení
Přeskočit na první nepřečtenou zprávu

Abraham Menacherry

nepřečteno,
12. 3. 2012 8:06:1412.03.12
komu: jetlang-dev
Fiber has schedule* methods just like the ScheduledExecutor service of
java.util.concurrent. Is there any performance/usability benefit in
using fiber methods. Or is it just a wrapper over the
ScheduledExecutor service?

Mike Rettig

nepřečteno,
12. 3. 2012 17:03:5412.03.12
komu: jetla...@googlegroups.com
The jetlang fiber does wrap the ScheduledExecutor. The key difference
is that the callbacks for the scheduled events will be executed on the
fiber thread and not on the scheduler thread. This fits with
jetlang's model of single threaded, lock free execution.

Mike

> --
> You received this message because you are subscribed to the Google Groups "jetlang-dev" group.
> To post to this group, send email to jetla...@googlegroups.com.
> To unsubscribe from this group, send email to jetlang-dev...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/jetlang-dev?hl=en.
>

Abraham Menacherry

nepřečteno,
14. 3. 2012 7:40:0214.03.12
komu: jetlang-dev
Mike,

Thanks for the explanation. I have one non-related query on the
SchedulerImpl class. Since the wrapped ScheduledExecutor is only used
to "schedule" and not to actually execute the callback, is there any
reason why one ScheduledExecutor instance is created for every
instance of SchedulerImpl class? Shouldn't it be some static instance
that is shared across all SchedulerImpl instances?

On Mar 13, 2:03 am, Mike Rettig <mike.ret...@gmail.com> wrote:
> The jetlang fiber does wrap the ScheduledExecutor.  The key difference
> is that the callbacks for the scheduled events will be executed on the
> fiber thread and not on the scheduler thread.  This fits with
> jetlang's model of single threaded, lock free execution.
>
> Mike
>
> On Mon, Mar 12, 2012 at 7:06 AM, Abraham Menacherry
>
Odpovědět všem
Odpověď autorovi
Přeposlat
0 nových zpráv