Did Java on Solaris once had a Fiber-like threads?
David Holmes
david.holmes at oracle.com
Sun Oct 13 02:37:16 UTC 2019
On 13/10/2019 6:03 am, Arkadiusz Gasiński wrote:
> Hi,
>
> Thanks for clarifying. I got only your mail directly, but noticed in the
> loom-dev digests that other replied as well, thanks!
>
> One follow up question I have now is: do fibers actually employ the M:N
> model? A week ago I would have said without any doubt that they do, but
> I guess I've read too much about multithreading models recently and now
> I'm confused.
I believe the current Fiber threading model is M:N in general, but at
time a Fiber may have to be pinned to a specific thread.
David
> Thanks,
> Arek
>
>
>
> On Wed, Oct 9, 2019 at 12:01 PM David Holmes <david.holmes at oracle.com
> <mailto:david.holmes at oracle.com>> wrote:
>
> On 9/10/2019 6:51 pm, Arkadiusz Gasiński wrote:
> > Hi,
> >
> > I recently found the "*JDK 1.1 for Solaris Developer's Guide*"
> article (
> >
> https://docs.oracle.com/cd/E19455-01/806-3461/6jck06gqe/index.html),
> which
> > says, in the Many-to-Many Model section, that "*a program can
> have as many
> > threads as are appropriate without making the process too heavy or
> > burdensome. In this model, a user-level threads library provides
> > sophisticated scheduling of user-level threads above kernel
> threads. The
> > kernel needs to manage only the threads that are currently active. A
> > many-to-many implementation at the user level reduces programming
> effort as
> > it lifts restrictions on the number of threads that can be
> effectively used
> > in an application.*"
> >
> > That's just the definition of the many-to-many model, but later
> in the same
> > section, it's written that "*The Java on Solaris operating
> environment is
> > the first many-to-many commercial implementation of Java on an MT
> operating
> > system*". If that's the case, it looks like there already was a
> version of
> > Java that had Fiber-like threads. Was it only some proprietary
> > implementation just for Solaris? What happened to it?
> >
> > BTW, if I understand correctly, the current versions of
> Open/Oracle JDK
> > employ the one-to-one multithreading models, correct?
>
> Java post "Green Threads" employs a 1:1 model with operating system
> threads. However Solaris also had a M:N model between user-level
> threads
> and kernel threads (LWPs). So Java was not actively using anything
> fiber-like, just plain java.lang.Thread that mapped 1:1 to a Solaris UI
> Thread but it could get some of the benefits that we're ascribing to
> Fibers, when running on Solaris (with the appropriate configuration
> options).
>
> https://docs.oracle.com/cd/E19455-01/806-5257/6je9h0349/index.html
>
> David
>
> > Thanks,
> > Arek
> >
>
More information about the loom-dev
mailing list