Project Loom Talk notes


Structured concurrency on the same blog

good introductionn, but bad ending:

Project looom better future

good summary:

What next for concurrent programming on JVM

Foundation futures

começar do exemplo do parallels…. stream


Concurrency x Paralelism

P: one task, make it run faster, (Care about duration/letancy), try to split in multiple sub tasks, and using multiple computing resources

C: many != taks, largeslyu independent and the problem is sovling, managing the multi tasks without giving computer resources, tasks number vs process, scheduling

Performance, important is thorugh put, number of transacions complete per minute

print 1 contexto of exception, é da thread debugger, step execution a single thread profile JFR, thread by thread basis

fundantal design java

p2 one implementation

coompromise pq é pra todos usos ()

p3 p4 code design harmonious with platform, number thing == nubmer threads, os, low limiting factor

p3 reuse with thread pools ao inves de criar, nos temo sum pool e toda vez que uma transcao precisa, nos usamos o reusmo

a thread nao é mapeada com uma single transacion, leak of thread locals, cancellation (interruption) as vezes qdo itnerrumpemos, ele já passou pra proxima task

mas ainda nao resolve escalabilidade, pq é o numero de threads do os

thread pode estar esperando alguma coisa processar, qdo tiver esperando, vamos retornar para o pool para ser reusada

normal blocking apis, nao funcionam como assim sync http client, jbdc etc. (precisa uasr apis diferentes)

thread em java define o contexto da operacao,

p5 desarmonious com a api



rethink threads

p8 threads in java

virtual threads slide

java concurrency, then and now

chart 2kb esquerda thread normal

como criar virtual threads

slide we are “just”

solved mane problesm, thread locals leaking,m interrepciopns, calcencalion

structured concurrency

in order to learn loom, you don’t need to learn anything, mas unlearn old habits never acte to pool, just creat string, vao criar milhoes

structure concurrency, way to organize threads

every time splies, with structure concurrencey you nhave to join before cointinu9ing (slide structure concurrency)

slide structured lok at the code, know ehre the control flow run

every task you submit to it, it will create a new thread


terminate, se terminou com os 30 segundos, se naodrop the threads running


Limitations? jNI blocking io, native monitor (sincronized), blocking IO, will suspende the virtual thread mas suspende a kernel thread (vc deve usar um dos java.concurrenty blocks reentry lock or stamp lock)

green threads x virtual (green schedule single os thread)

thread dump funcionality (stack of 1mi threads)

blocking file/io

Effective Java executors (olhjar no livro), agora tem que usar o virtualthread executor

qdo usar o heavy weight, virtual thread verygood trans. processing i/o executa um pouco e blocka, mas qdo eu vou fazer uma task grande, inverter uma matrix, converter um video a lot of processing vc ianda pode querer usar o normal

Control CPUs, default scheduler fork join pool, number of coorls (set by command line flag) or you can just apply your own scheduler

I/O bound processing applications -> virtual threads (anything that blocks frequently) CPU bound virtual threads will not help you

Project Loom reasoning: solve the dileme, wasting hardware or harmonious code, wrihte async code performance loom, but get harmonious

syncronized and IO inside the sync block (temporary limitation), replase with reeintranmt/stramp lock


bulk heading (olhar o que é) SEDA

Comppl, features will work out of the box (you iwll only need get mostly now, becuase most of them are designed to do async programming, because you do a blocking because free I’m doing this because blocking is ex43pesnei? maybe yo udon’t need to do that, maybe something very simple will do )

Reactive fraemworks

Reactive Streams,

loom veio pq é mto impopular,


exemplo pra talk:

Index _