Thin wrapper over OS threads Ø One-to-one mapping with OS threads Ø Thread pools Virtual Threads Virtual Threads: Ø Lightweight user threads Ø Highly scalable Ø No need for pooling
a representation of the current state of the program or Ø ‘the rest of the computation’ Ø It allows us to pause execution of a program (or part thereof) and resume it later. Ø WARNING: Continuation API in Java is not supposed to be used directly by application developers. For now, it is only used internally to implement virtual threads.
function that ‘yields’ values. Ø These values are lazily retrieved. Ø They can then be iterated over by using a loop. { //… //… yield 1; //… //… yield 2; //… //… yield 3; //… //… yield 4; } Generator while () { // … } Consumer
not use CPU (or platform thread) when waiting/ blocking. Ø A VirtualThread can get mounted on several platform threads during its lifetime. Ø A platform thread can support several VirtualThread-s during its lifetime.