What are the thread limitations when working on Linux compared to processes for network/IO-bound apps?

后端 未结 2 1305
难免孤独
难免孤独 2020-11-29 17:07

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

2条回答
  •  星月不相逢
    2020-11-29 17:41

    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.

提交回复
热议问题