i want to experiment with a simple socket (similar to http://devzone.zend.com/node/view/id/1086)
listener script which runs in and endless loop.
(php-cli on ubuntu edgy, php version is 5.1.6 )
to my suprise i noticed that even a simple empty loop like
Code: Select all
#! /usr/bin/php
<?php
while(1) {
}
?>even if i assume that the whole php interpreter stays in memory
during execution that would be 4 or 5MB. the zend example takes exactly the same memory btw.
whats the efficient way of writing such long running script?
i looked for tutorials but couldnt find any good help.