Virtual thread: Difference between revisions

Content deleted Content added
Soc88 (talk | contribs)
Undid revision 1145781980 by MarioGom – green threads and virtual threads are not the same, that would be like equating segmented memory and virtual memory
Tags: Removed redirect Undo
Soc88 (talk | contribs)
first, minor improvements and fixes
Line 1:
{{Short description|Computational threads scheduled by a run-time library}}
{{Distinguish|green thread}}
In [[computer programming]], '''virtual threads''' are [[Thread (computing)|threads]] that are scheduledmanaged by a [[runtime library]] insteadand ofmade nativelyto byresemble the"real" underlying [[operating system]] (OS).threads to code executing on them, while requiring substantially fewer resources than the latter.

Virtual threads allows for tens of millions of preemptive tasks and events without swapping 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= |df= |accessdate=}}</ref> compared to low thousands of operating system threads.<ref>{{Cite web |last=baeldung |date=2022-01-02 |title=Maximum Number of Threads Per Process in Linux {{!}} Baeldung on Linux |url=https://www.baeldung.com/linux/max-threads-per-process |access-date=2022-03-30 |website=www.baeldung.com |language=en-US}}</ref> Preemptive execution<ref>{{Cite web |title=Go 1.14 Release Notes - The Go Programming Language |url=https://go.dev/doc/go1.14#runtime |access-date=2022-03-30 |website=go.dev}}</ref> is important to performance gains through parallelism and fast preemptive response times for tens of millions of events.

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>
 
== Definition ==