3 ms·
> The example given by the author seems risky to me Ages ago I made a DNS server, and near the top of the program was a simple: for(i=0;i<ncpus;++i)if(!fo
by geocar 8y ago
> The example given by the author seems risky to me
Ages ago I made a DNS server, and near the top of the program was a simple:
for(i=0;i<ncpus;++i)if(!fork())break;
> Most use cases seem covered by either threads or fork+exec process spawning.
Most of the use cases of threads are covered by fork+explicit mmap/vm_remap.
A "shared-nothing" will also contain less code, and having no need for lock/unlock keeps a lot of spam invalidations away from the memory controller making it for many tasks faster.
> Even if you're safe from other threads, there is a lot of other unknown state like fd's still inherited.
The problems you get with threads are bigger.
http://geocar.sdf1.org/close.html http://geocar.sdf1.org/close.html