Answer the question
In order to leave comments, you need to log in
How to speed up the number of threads per second (comparison of threads in elrang and c#)?
Right now there are 1000 threads in c# that start, run, close in 1 minute.
That is, about 16 threads are obtained per second.
Computer i7
4 real cores
4 virtual cores
when the program is running, the load of all cores is up to 30-49%
Question
What will we get with threads on elrang?
A similar situation is 16 threads per second, or can erlang increase this number of threads per second?
Or do we have here a physical limitation on the cores, that is, on average, somewhere around 2 (4) C # threads per 1 (2) processor cores?
Answer the question
In order to leave comments, you need to log in
What are the threads actually doing? Numbers thresh or what kind of I/O do they produce? Maybe it's not the threads?
If only numbers are threshing, then in any case we will run into the number of cores / threads, no matter what language. If they also do I / O, then there are a lot of options. In the presence of light streams, especially short-lived ones, such as erlang / scala, they can be created more, if the streams are long-lived (), then again we run into cores / streams.
Yes, in fact, I / O itself consumes the processor and can slow down physical threads while waiting for I / O.
If these streams don't consider complex math - Erlang wins 100%. You don't even need to discuss.
One should distinguish between OS threads and processes in Erlang. I don't know about C#, but as far as I understand it makes OS threads (they are very heavy), to make an OS thread you need to do a lot of things.
Erlang processes, in contrast to threads, are very lightweight, for example, they occupy at least 512 bytes in memory, they are quickly created, quickly killed. The OS does not know about these processes, Erlang takes care of all maintenance work (simultaneous execution on available kernels).
In the OS, you can make a limited number of threads, up to 5000.
In Erlang, you can multiply processes as you like, the main thing is that there is enough memory. The order of the number is 100000-1000000.
PS Add Erlang tag.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question