2 ms·
I guess you are right - I haven't been able to find the sources I was remembering that gave me this idea. Maybe it was just about pid_max. The default of about
by akvadrako 9y ago
I guess you are right - I haven't been able to find the sources I was remembering that gave me this idea. Maybe it was just about pid_max. The default of about 32K clearly wouldn't cut it.
The max is only 4M so I guess I'll change my statement to be linux doesn't handle millions of threads very well.
- dekhn 9y agoYou're probably thinking of Linux's older thread system, LinuxThreads, which didn't scale at all. It was replaced with NPTL, which scales far better. I think also the kernel scheduler got much better. I'm not aware of any system that manages millions of threads well- it's also not clear what the usecase for this would be.
- akvadrako 9y agoI'm not thinking of LinuxThreads, but internally Linux still treats threads and processes as one. So each thread is assigned a PID. As per the top post, millions of threads means there is no need to implement your own scheduling system with async IO, which can handle millions of idle connections.