Slide 18
Slide 18 text
2/5/2025
Copyright © 2024, Oracle and/or its affiliates
18
1) It blocks threads
Blocking a platform thread is wrong, for many reasons
(Here it is blocked for ~100ms)
Concurrency Issues
ExecutorService es = ...;
var f1 = es.submit(someService::readImages);
var f2 = es.submit(someService::readLinks);
var page = new Page(f1.get(1, TimeUnit.SECONDS),
f2.get(1, TimeUnit.SECONDS));
-> ES thread is blocked
-> ES thread is blocked
-> the main thread is blocked