0

I am tossing up the pros and cons of thread-based parallelism vs. process-based parallelism in terms of efficiency.

In both cases, I am binding to CPU cores and the given process/thread will be sole owner of the core.

Given these constraints, I was thinking that efficiency of both would be about the same, save for TLB usage where the multi-threaded solution would have the efficiency advantage.

Does this seem right?

Nathan Doromal
  • 3,437
  • 2
  • 24
  • 25
  • This seems to agree https://stackoverflow.com/questions/5440128 Personally, I'm all for threads over process, but this is getting into opinion-based land. My view is that the management of thread and the maintainability over process outweighs any possible (even if non-existent) gains of processes. – Jeffrey May 28 '20 at 18:36
  • With a caveat: in a prod environment, your support team will be able to kill a subset of processes, externally. They won't be able to kill a subset of threads. – Jeffrey May 28 '20 at 18:37
  • Any locking needed? Cross process locks are more expensive I think. – Richard Critten May 28 '20 at 18:48
  • I saw that question. The part I was unsure about is, since the thread/process run hot, there shouldn't be any context switching, and that would put the cost comparison much closer. In terms of locking, I think any thread synchronization could be placed in shared_memory and, correct me if I am wrong, should have the same performance characteristics. – Nathan Doromal May 28 '20 at 18:52

0 Answers0