Answer the question
In order to leave comments, you need to log in
What languages have analogues of goroutines in terms of performance and simplicity?
There is a Go language and it has wonderful Goroutines. For example, I wrote a simple program that performs thousands of simultaneous calls to remote nodes, while a program similar in functionality in Java or another language that uses native OS threads would eat up many times more system resources (and the Go program does not load the CPU). by more than 30% and this is on an old computer with a running browser, eclipse and other garbage and not particularly optimized).
The Go language certainly provides a convenient and seemingly unique multi-threading model (goroutines + channels), but, in my opinion, this is all the good that can be said about it. The language itself is poor, about which quite a few articles have been written.
The question is, are there real alternatives to goroutines in other languages in terms of performance and overhead?
Answer the question
In order to leave comments, you need to log in
at the same time, a program similar in functionality in Java or another language that uses native OS threads would consume many times more system resources
Take a look at dlang.org and in particular vibed.org The syntax is much nicer than that of Go.
Use Go where goroutines are needed, and for other tasks, the language that is more convenient for you.
Lightweight streams at the library level are available in almost all modern languages. For the JavaVirtualMachine you mentioned, it's Akka-Skala. In Go, streams and channels are introduced into the syntax of the language, resulting in a 'select case' construct that is extremely difficult to implement in libraries. Hoare's ideology of Communicating_Secuential_Processeses is fully implemented in Erlang at the syntax level, with the difference from Go that the streams are named and can be accessed personally (only channels are named in Go). You can easily write your dispatcher on libthreads and epoll, kqueue system calls. Also, the specific task of thousands of accesses to remote nodes can be implemented with a simple cycle, which, in essence, happens under the hood, and such a particular solution to a specific task will always be more efficient.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question