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 limitations on the IO, so that 1 process with 8 threads on 8-core server might be slower than 8 processes.
Any comments? Are there other limitation which might slow the applications?
The applications is a network C++ application, serving 100s of clients, with some disk IO.
Update: I am concerned that there are some more IO-related issues other than the locking I implement myself… Aren’t there any issues doing simultanious network/disk IO in several threads?
Drawbacks of Threads
Threads:
mmap()that perform page allocations.open(),accept(),fcntl()must lock it to translatefdto internal file handle, and when make changes.malloc()andfree()operate on a global data structure (that can to some degree be worked around). There are other global structures also.Processes or Threads?
SIGSEGV/PIPEis 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).Links