4 ms·
To be fair though M:N threads aren't the provenance of research language, Go and Rust both have them, and I'm sure some other languages. (But it's awesome Java
by maxbond 4y ago
To be fair though M:N threads aren't the provenance of research language, Go and Rust both have them, and I'm sure some other languages.
(But it's awesome Java has them now too, other languages getting the feature earlier doesn't really devalue it.)
- kaba0 4y agoRust doesn’t have them, though.
- maxbond 4y agoIn what way? async-std and tokio both support M:N.
- kaba0 4y agoBut they can’t turn blocking calls to non-blocking which is the whole point, that requires runtime support.
- maxbond 4y agoOh interesting, that's very cool, I didn't realize Java was doing that. That's a different axis than M:N though (cooperative versus preemptive) and you could definitely write a preemptive async runtime for Rust (rtic comes to mind). But the async-std and tokio runtimes are certainly cooperative. (As a note, cooperative scheduling also requires a runtime - Rust might not "have a runtime" by default but you need to opt into one to use async.)
- marginalia_nu 4y agoMy point is that they're on diametrically opposite ends of the language-philosophical spectrum.
- kjto 4y ago.net has had this feature for a decade++
- marginalia_nu 4y agoYeah, so has a lot of languages. See the previous comment.
- kjto 4y agoyou’re trying to support “judicious and conservative” but realistically java is on a lifeline like fortran, delphi and objectiveC
- kaba0 4y agoThat “lifeline” is apparently the same the internet is on.
- marginalia_nu 4y agoWhat are you basing this sentiment on?
- spuz 4y agoWhat is the virtual thread feature in .NET called? I can't find any information about it.
- kjto 4y agoTasks, simple intro here https://code-maze.com/csharp-tasks-vs-threads/ https://code-maze.com/csharp-tasks-vs-threads/
- spuz 4y agoThat looks similar to Java FutureTasks + Executors which is a very different concept from virtual threads. Virtual threads mean that a blocking thread can yield to any other non blocking thread seamlessly and with very little overhead. .NET Tasks cannot do this as far as I can tell.