3 ms·
48 independent threads and 48 processes can be very different on some operating systems. A process is more heavyweight. You will - amongst other things - incr
by shin_lao 16y ago
48 independent threads and 48 processes can be very different on some operating systems.
A process is more heavyweight.
You will - amongst other things - increase the charge in terms of handles. For example, 48 processes maintaining the same network connections is a waste of resources.
I'm afraid you might hit a wall with your single threaded approach.
This is definitely not the road we have chosen (but we wish the best of luck nonetheless! :) ).
- antirez 16y agoIn a shared nothing environment you need 48 different sockets, distinct data structures, and so forth. Given the copy-on-write strategy of many OSes the overhead can really be minimal (you'll not get N copies of the executable in memory). The context switching should be more or less the same cost... what I mean is that it's trivial to turn the N proesses design into N independent threads design, as there is no problem with locking, but it is probably not a win.
- liuliu 16y agoFor now redis only perfectly run on Linux; I think that process is not heavyweight at all. As my recall, thread on Linux is just process with shared resource.