I\'ve heard that under linux on multicore server it would be impossible to reach top performance when you have just 1 process but multiple threads because Linux have some li
Threads:
mmap()
that perform page allocations.open()
, accept()
, fcntl()
must lock it to translate fd
to internal file handle, and when make changes.malloc()
and free()
operate on a global data structure (that can to some degree be worked around). There are other global structures also.SIGSEGV/PIPE
is all it takes...).accept()
s them), and CPU is a bottleneck, use processes and single-threaded runtimes (which are devoid of all kinds of intense locking such as on the heap and other places).it really should make no difference but is probably about design.
A multi process app may have to do less locking but may use more memory. Sharing data between processes may be harder.
On the other hand multi process can be more robust. You can call exit() and quit the child safely mostly without affecting others.
It depends how dependent the clients are. I usually recommend the simplest solution.