3 ms·
I stand corrected. And frightened. fork(), here I come!
by jey 17y ago
I stand corrected. And frightened. fork(), here I come!
- cma 17y agofork() isn't that great for a lot of situations. If you are thinking of taking advantage of your operating system's copy-on-write paging by loading a large chunk of data to be used read-only, forking a bunch of processes, processing the data each processes, and finally, 'reducing' the results of all of the forks into some sort of output, don't bother. What happens is when you read an object in one process, python increments the reference count, thus touching the memory page, thus copying it, thus screwing you. (however, compacting garbage collection turns out to have more or less the same problem)