General statistics
List of Youtube channels
Youtube commenter search
Distinguished comments
About
Mikko Rantalainen
ThePrimeTime
comments
Comments by "Mikko Rantalainen" (@MikkoRantalainen) on "How Much Memory for 1,000,000 Threads in 7 Languages | Go, Rust, C#, Elixir, Java, Node, Python" video.
I agree that the problem was that the benchmark was "running concurrently" when every "thread" was sleeping. If every thread had acquired accurate timestamp from the OS, formatted it into a string and appended it into a file as a single line and repeated that 100x before exiting, we would have seen at least some real processing and you could check the timestamps to see how concurrently things were happening. With a "task" that sleeps and exists you basically have a queue of tasks than can be processed one after another. Zero parallelism.
1
Typically the system wide mmap max limit prevents running 100k threads by default on Linux. In practice you may need to adjust following settings: /proc/sys/kernel/threads-max /proc/sys/vm/max_map_count /proc/sys/kernel/pid_max And of course, you need 64 bit CPU and OS but I guess that should be default today.
1