Btw, there's a *very* beta (and not currently maintained) event extension on pecl somewhere that supports epoll(), kqueue(), etc. I haven't played too much with it, because in cases where I need to use advanced polling engines I probably don't need to be using PHP for whatever I need to do :P
Anyway, the easiest solution whenever you need to do something involving a while() is almost *always* have a sleep() or usleep() call at the end of it. Even if it's only a miniscule stop it tends to make a big difference depending on what you're doing. Another failsafe is turning a while() into a for() loop with an arbitrary upper bounds (100000 for example) during debugging. At least that way, when you're testing things out, if something gets out of hand, the loop will break on its own. From that point, it's easy to simply convert the for() back to a while() once you know nothing bad will happen. Cheers. -slakr (@en.wp) On Wednesday 23 January 2008 11:56, Bryan Tong Minh wrote: > On Jan 23, 2008 6:53 PM, Daniel Schwen <[EMAIL PROTECTED]> wrote: > > > > That would be the obvious choice. But unfortunately there seems to be > > > > no way to realize that in PHP. And furthermore if the fifo has no > > > > listener > > > > > > http://nl2.php.net/manual/fi/function.stream-select.php ? > > > > How do I get a stream object to pass to stream_select? fopen? fopen is > > already blocking if my fifo listener is dead. > > -- > > > > [[en:User:Dschwen]] > > [[de:Benutzer:Dschwen]] > > [[commons:User:Dschwen]] > > > > _______________________________________________ > > Toolserver-l mailing list > > [email protected] > > http://lists.wikimedia.org/mailman/listinfo/toolserver-l > > Ah I assumed that the blocking occurred in fread. stream_select won't > work for fopen :( > > Bryan > > _______________________________________________ > Toolserver-l mailing list > [email protected] > http://lists.wikimedia.org/mailman/listinfo/toolserver-l _______________________________________________ Toolserver-l mailing list [email protected] http://lists.wikimedia.org/mailman/listinfo/toolserver-l
