An Analogy
Bazlur Rahman
anmbrr.bit0112 at gmail.com
Tue Jul 19 19:12:51 UTC 2022
Hey Eric,
A great analogy, I wonder if I can use it in my talk at the PhillyJUG (of
course, using your reference) today.
*Thank you,*
*-*
*A N M Bazlur Rahman*
On Tue, Jul 19, 2022 at 2:34 PM <eric at kolotyluk.net> wrote:
> I am hoping this is an apt analogy, so please correct me if it is wrong…
>
>
>
> Before Loom, concurrency was like going to a bank with a fixed number of
> tellers, where each teller had a line of customers.
>
>
>
> 1. In Java terms, a teller is like Platform Thread
> 2. Generally, it would take time to process each customer, say an
> average of 5 minutes
> 3. Sometimes, a customer would block the process, such as the teller
> needed to make a phone call to get some information
> 4. No work is performed, while the teller is blocked waiting, and
> consequently the entire line is blocked
>
>
>
> After Loom, concurrency is like going to a bank with more modern policies
> and procedures
>
>
>
> 1. In Java terms, a teller is still like a Platform Thread, but has
> the ability to park a customer
> 2. Generally, it still takes time to process each customer, say an
> average of 5 minutes
> 3. Sometimes, a customer would block the process, such as the teller
> needed some information before proceeding…
> 1. The teller sends a text message or emails to get the necessary
> information
> 2. The teller asks the customer to be seated, and as soon the
> information is available, they will be the next customer processed by the
> first available teller
> 3. The teller starts processing the next customer in line
> 4. This is analogous to a parked Virtual Thread, where the teller
> is like a Platform Thread, and the customer is like a Virtual Thread
> 4. Concurrency is increased, by better policies and procedures in
> dealing with blocking operations
>
>
>
> Yes, this is very simplistic, but intentionally so to try to expose what
> is so great about Virtual Threads.
>
>
>
> Cheers, Eric
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/loom-dev/attachments/20220719/8e163ff6/attachment-0001.htm>
More information about the loom-dev
mailing list