Il Wed, 31 Oct 2012 11:50:00 +0100, ma...@behnke.biz ha scritto:

> The drawback of forking is the memory overhead. With every fork you take
> the same amount of memory which is not the case if you could use real
> threads.

No, it is not.
Forking in Linux uses COW (copy-on-write), so a freshly-forked process 
occupies maybe 3-400 bytes of RAM. Only when writing on a memory 
location, that location gets allocated.

There are advantages (it is more safe, as you can't overwrite other 
processes' memory) and disadvantages (you can't simply read or write 
memory to communicate between threads, but must use IPC).

But speed and memory consumptions are not an issue.

Bye.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to