multithreading or multiprocessing

后端 未结 8 838
野的像风
野的像风 2021-02-02 03:14

I am designing a dedicated syslog-processing daemon for Linux that needs to be robust and scalable and I\'m debating multithread vs. multiprocess.

The obvious objection

8条回答
  •  迷失自我
    2021-02-02 04:05

    One question is whether it's necessary to do either. I don't know the details of your requirements, but a single threaded app using select(2) may fit your needs and not have the disadvantages of either processes or threads. This requires that you be able to centralize all of your I/O into one central place, most likely dispatching to other modules via callbacks, but that isn't all that hard unless you have a lot of libraries that want to do their own I/O and can't be restructured in this way.

提交回复
热议问题