Re: Multithreading for OOP PHP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Il Wed, 31 Oct 2012 11:50:00 +0100, marco@xxxxxxxxxx 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



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux