Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Green threads in .NET

Tags:

Green threads were introduced in Erlang and probably all languages based on it know them, also in go (gorutines). Then afaik they were removed from rust.

My questions:

  • How would one implement green threads in .NET? Are there some caveats that prevent current .NET runtime from implementing them?
  • Does it even makes sense in terms of performance? We have a quite lightweight Task and in (near) future we will have even ValueType Task (more suitable for some scenarios)...
like image 264
stej Avatar asked May 17 '16 20:05

stej


1 Answers

In computer programming, green threads are threads that are scheduled by a runtime library or virtual machine (VM) instead of natively by the underlying operating system. Managed Threads written with NET Framework will be scheduled by framework but whatever be the case Windows OS will be running beneath and attaching threads to CPU (as NET requires Windows).

like image 149
SACn Avatar answered Sep 18 '22 13:09

SACn