How does Project Loom Fibers/Green threads help in Anyway ?

kant kodali kanth909 at gmail.com
Wed Jan 17 10:31:35 UTC 2018


Hi All,

I came across the links below and I wondering how Fibers can really help ?
when compared to using a thread pool (which is a pool of kernel threads)?
Sure having both options is great but I am trying to understand what
difference can it make in terms of performance ?

Here is what I know

1) Kernel threads are expensive and the default stack size is in MB's
whereas Fibers can have a small stack size somewhere in KB's so one can
create as many of them. so what? eventually they all have to map to Kernel
threads and thread pool exists so user don't create as many as say Fibers.
isn't it?

2) Fibers have no idea about kernal threads and vice-versa. so if a Fiber
makes a blocking system call it has not idea that the kernel thread is
blocked and there is no upcall mechanism by any major OS.

3) One can argue Fibers are great when a program is making lot of async
calls but I wonder how this is any better in terms of performance when
compared to having small thread pool that makes async calls? If this is all
about expressing something gets easier in Fibers than using thread pool but
there is no performance difference then I must say this is more of a
subjective call so everyone can have their own opinion.

At this time, I am not seeing how Fibers can be better performant than
having a pool of Kernel threads? if they are in some cases can someone
please provide any examples so I can enlightened?

http://cr.openjdk.java.net/~rpressler/loom/Loom-Proposal.html
https://hn.svelte.technology/item/15599854

Thanks!


More information about the loom-dev mailing list