News for hackers. Stuff that matters.
Re:Announcing .NET Core 1.0 by jdmichal on Monday June 27, 2016 @03:28PM (#11988773)
I don't know of any green threads in .NET -- at least, not built in. However, .NET does have a built-in thread pooling / task execution service. You generally interface via `System.Threading.Tasks.Task`[0], which has static `Run` functions, or use the `Factory` property to get the underlying `TaskFactory` for more fun. Since the executors are pooled, the creation costs will be amortized over your program's lifetime.

Then there's `async`/`await`[1], which is built on top of tasks.

[0] https://msdn.microsoft.com/en-us/library/system.threading.ta...

[1] https://msdn.microsoft.com/en-us/library/mt674882.aspx

Re:Announcing .NET Core 1.0 by int_19h on Monday June 27, 2016 @04:45PM (#11989325)
I remember that a long time ago, .NET threading was implemented in such a way that it should, in theory, support Win32 fibers. It's why all the low-level .NET APIs don't use the OS thread IDs, but instead have their own IDs, and require explicit mapping.

I believe that it was abandoned as a supported scenario a while ago, though. But you can still see artifacts of that in the docs, e.g.:

https://msdn.microsoft.com/en-us/library/system.threading.th...

"The value of the ManagedThreadId property does not vary over time, even if unmanaged code that hosts the common language runtime implements the thread as a fiber."