Content deleted Content added
m →Complexity: Grammar |
Citation bot (talk | contribs) Altered title. Removed parameters. | Use this bot. Report bugs. | Suggested by Dominic3203 | Category:Virtualization | #UCB_Category 7/40 |
||
Line 3:
In [[computer programming]], a '''virtual thread''' is a [[Thread (computing)|thread]] that is managed by a [[runtime library]] or [[virtual machine]] (VM) and made to resemble "real" operating system thread to code executing on it, while requiring substantially fewer resources than the latter.
Virtual threads allows for tens of millions of preemptive tasks and events on a 2021 consumer-grade computer,<ref name="javaworld2">{{cite web |last1=Rudell |first1=Harald |date=2022-03-19 |title=massivevirtualparallelism |url=https://codeberg.org/haraldrudell/massivevirtualparallelism/src/branch/main/README.md |website= |quote
Earlier constructs that are not or not always preemptive, such as [[coroutine]]s, [[green thread]]s or the largely single-threaded [[Node.js]], introduce delays in responding to asynchronous events such as every incoming request in a server application.<ref>{{Cite web |last=Node.js |title=Don't Block the Event Loop (or the Worker Pool) |url=https://nodejs.org/en/docs/guides/dont-block-the-event-loop/ |access-date=2022-03-30 |website=Node.js |language=en}}</ref>
Line 16:
* Virtual threads can hop over the execution units of all processors and cores
** This allows utilisation of 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 an execution unit can steal virtual threads from another execution unit<ref>{{Cite web |last=Lu |first=Genchi |date=2021-07-22 |title=
* Virtual threads require no yield or similar interventions by the programmer
** Virtual threads appear to execute continuously until they return or stop at a synchronization lock
|