This is the mail archive of the
cygwin-patches@cygwin.com
mailing list for the Cygwin project.
Re: Performance: fhandler_socket and ready_for_read()
On Wed, Jul 31, 2002 at 02:11:16AM +0100, Conrad Scott wrote:
>"Christopher Faylor" <cgf@redhat.com> wrote:
>> Unless you disagree, would you mind just adding a
>> get_r_no_interrupt method to fhandler_socket,
>> using the same criteria as your ready_for_read stub?
>
>No disagreement there, that's cleaner. See attached for a new
>patch.
>
>> Thanks for finding this, by the way. A speed improvement in
>> socket handling is very welcome.
>
>Thanks. And yes, after this patch cygserver with sockets is still
>not as quick as with named pipes, but it's made up a lot of
>ground.
>
>> Sounds like it is time for a 1.3.13 release.
>
>Ominous numbers those . . . I'm just glad I'm not superstitious
>:-)
If it helps, I was born on Friday the 13. So this might be a lucky
number.
>+bool
>+fhandler_socket::get_r_no_interrupt ()
>+{
>+ if (!is_nonblocking () && winsock2_active)
>+ return true;
>+ else
>+ return fhandler_base::get_r_no_interrupt ();
>+}
>+
> void
> fhandler_socket::set_connect_secret ()
> {
Maybe I'm missing something but I don't think it has to be this complicated.
I think this should just be basically:
bool
fhandler_socket::get_r_no_interrupt ()
{
return winsock2_active;
}
You don't have to worry about non_blocking or returning the base class
because you know that it is not intended to be called for the non_blocking
case and you know that sockets are "slow" devices. So I think this should
only be gated on whether we're lucky enough to be using winsock2.
cgf