3 ms·
Ask HN: Besides Go, what languages are muti-threading "in background"?
I mean, no need to write "async/await".
- stop50 3y agoI think the tokio library does this for rust
- mrudolph22 3y agoJava 21+ (virtual threads).
- pjmlp 3y agoJava already did it in the past, that is why we have the notion of green threads versus red threads. What virtual threads bring to the table is that now they are both officially supported, with APIs for both cases, while previously it was an implementation detail of each JVM how threading was actually done.
- viraptor 3y agoI think you're mixing up async execution and multithreading. They're quite different concepts, although you can offload an awaited work on another thread. Almost any language supports spawning a new thread.
- stanlogin 3y ago"in background"
- viraptor 3y agoWhat does that mean?
- stanlogin 3y agoI don't think its difficult to understand. Look at the other two answers.
- viraptor 3y agoNo, it really is. I've got experience with multiple languages / multithreading approaches and could argue it means 3 different things. I don't know what others think the question is about.
- stanlogin 3y agoOK. It's difficult to you.
- pjmlp 3y agoOP is right. In Go you always need a keyword (go something) to start a co-routine, well, in C# you do exactly the same with Task.Run(something), while it also supports async/await. Additionally, LINQ can make use of background execution via PLINQ, Dataflow Tasks allow to use a DSL to orchestrate executions that happen in the background, the early BeginInvoke()/EndInvoke() can make use of threads or not, and for all of that, we can also write our own scheduling algorithm and give it to the runtime scheduler. So yeah, it depends how rich the language runtime happens to be, even if async/await are also supported.
- deleted 3y ago[deleted]