Controlling the VirtualThread.scheduler
Peter Veentjer
alarmnummer at gmail.com
Tue Jun 7 12:01:35 UTC 2022
Hi Ron,
Thanks for your reply.
If I access the constructor using reflection and add the EventloopThread as
a scheduler (it's already a scheduler), the VirtualThread should remain
contained within the EventloopThread?
My primary goal is to experiment with the combination of Loom and the
thread per core design.
Regards,
Peter.
On Tue, Jun 7, 2022 at 1:33 PM Ron Pressler <ron.pressler at oracle.com> wrote:
> Hi.
>
> The plan is to ultimately allow custom schedulers, but we want to first let
> the ecosystem learn about virtual threads and their uses with the default
> scheduler.
>
> — Ron
>
> > On 7 Jun 2022, at 06:09, Peter Veentjer <alarmnummer at gmail.com> wrote:
> >
> > Is it possible to configure the Scheduler in the VirtualThread?
> >
> > I'm working on a thread per core design. Each CPU runs a (pinned)
> platform
> > thread called the EventloopThread which runs the actual eventloop. And
> all
> > VirtualThread created in the EventloopThread should be tied to their
> owning
> > EventloopThread. They should never be allowed to run on any other
> thread.
> >
> > The constructor of the VirtualThread does allow for a scheduler to be
> > passed, but it is private and on initial inspection, it seems there is no
> > proper entrance to configure the scheduler. Either a null scheduler is
> > passed or some 'test' instance. So as a consequence, it seems that
> > VirtualThreads are always executed on an ForkJoinPool and hence can run
> on
> > any Thread.
> >
> > Regards,
> >
> > Peter.
>
>
More information about the loom-dev
mailing list