Re: [PHP4BETA] select() Design Notes

From: Date: Sat, 04 Dec 1999 15:10:33 +0000
Subject: Re: [PHP4BETA] select() Design Notes
References: 1  Groups: php.version4 
Request: Send a blank email to php-version4+get-7398@lists.php.net to get a copy of this message
On Sat, 4 Dec 1999, Christian Schneider wrote: | Evan Klinger wrote: | > Good point. However, there'd still need to be a fd_set(fd_resource) | > function to see if the fd_resource is set. Or am I missing something? | | Hmm... FD_ISSET() is the name of the corresponding function/macro. | You could leave the fds in the same position inside the array and replace all | non-matching ones with -1 (invalid) which would closely mimic the C-Version. | But OTOH I think it's easier to have the array contain just the valid ones. | Acting on the fds would then be a foreach ($array as $fd) ... | | Is there something I'm missing? Mixed type fds could be handled with something | like forach ($read_fds as $fd) $fdhandlers[$fd]->read($fd); My only problem with the array approach is that creating arrays adds some overhead. I think some performance testing between an array approach and using an fs_isset() function would be good, testing sets of 1 to 255 file descriptors. - Stig

« previous php.version4 (#7398) next »