r/C_Programming • u/Read-Documentation-7 • Jun 07 '26
Why Processes?
Hello. I was wondering what are the benefits of using processes over threads. I understand the differences between the two, but I am having trouble trying to understand when would be the best use case to implement them. Can someone give me some advice for when processes should be used? Thanks.
38
Upvotes
View all comments
Show parent comment
5
u/protestor Jun 08 '26
you can have shared memory between processes too, without expensive IPC. you can either use atomics across processes (works just like atomics across threads), or.. you can use some inter-process mutexes (all major OSes have this)
the main difference between processes and threads is that with threads everything is shared by default, with processes you can choose what things you want to share. so processes give a greater degree of control