Fiber as a scheduled executor

46 views
Skip to first unread message

Abraham Menacherry

unread,
Mar 12, 2012, 8:06:14 AM3/12/12
to 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

unread,
Mar 12, 2012, 5:03:54 PM3/12/12
to 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

unread,
Mar 14, 2012, 7:40:02 AM3/14/12
to 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
>
Reply all
Reply to author
Forward
0 new messages