Virtual thread: Difference between revisions

Content deleted Content added
Line 23:
# Virtual Threads can hop over all processors and cores
## This allows for using all available hardware, a 10x increase on today’s computers
## In the go1.18 implementation, there are virtual thread queues per execution unit. There are additional virtual threads not allocated to an execution unit and onean execution unit can steal virtual threads from another execution unit<ref>{{Cite web |last=Lu |first=Genchi |date=2021-07-22 |title=Java’s Thread Model and Golang Goroutine |url=https://medium.com/@genchilu/javas-thread-model-and-golang-goroutine-f1325ca2df0c |access-date=2022-04-05 |website=Medium |language=en}}</ref>
# Unlike co-routines, there is no yield or other intervention by the programmer
## Unlike co-routinescoroutines, if a virtual thread is in an infinite loop, it does not block the program. Execution continues at a higher cpu load, even if there are more looping threads than available execution units
# Today’s implementations of Virtual Threads have smaller, managed stacks
## This allows for many magnitudes more threads than from using OS threads