From: Eli Zaretskii <eliz@gnu.org>
To: claudio.bley@gmail.com (Claudio Bley)
Cc: emacs-devel@gnu.org
Subject: Re: Calling 'select' from emacs_gnutls_pull
Date: Fri, 22 Feb 2013 14:36:46 +0200 [thread overview]
Message-ID: <83ehg8mso1.fsf@gnu.org> (raw)
In-Reply-To: <87k3q0wqef.wl%claudio.bley@gmail.com>
> From: claudio.bley@gmail.com (Claudio Bley)
> Date: Fri, 22 Feb 2013 12:15:36 +0100
>
> However, applying the obvious patch:
>
> --- >8 ---
> --- src/w32.c Thu Feb 21 14:35:43 2013
> +++ ../build/src/w32.c Fri Feb 22 08:32:35 2013
> @@ -7837,27 +7837,9 @@
>
> err = errno;
>
> + /* Translate the WSAEWOULDBLOCK alias EWOULDBLOCK to EAGAIN. */
> if (err == EWOULDBLOCK)
> - {
> - /* Set a small timeout. */
> - timeout = make_emacs_time (1, 0);
> - FD_ZERO (&fdset);
> - FD_SET ((int)fd, &fdset);
> -
> - /* Use select with the timeout to poll the selector. */
> - sc = select (fd + 1, &fdset, (SELECT_TYPE *)0, (SELECT_TYPE *)0,
> - &timeout, NULL);
> -
> - if (sc > 0)
> - continue; /* Try again. */
> -
> - /* Translate the WSAEWOULDBLOCK alias EWOULDBLOCK to EAGAIN.
> - Also accept select return 0 as an indicator to EAGAIN. */
> - if (sc == 0 || errno == EWOULDBLOCK)
> - err = EAGAIN;
> - else
> - err = errno; /* Other errors are just passed on. */
> - }
> + err = EAGAIN;
>
> emacs_gnutls_transport_set_errno (process->gnutls_state, err);
>
>
> --- >8 ---
>
> and made a few tests using POP3 and IMAP connections over TLS and
> HTTPS connections. Works good.
That's good news.
> Average for with-select key over 3 runs
>
> Version Number: Windows NT 5.1 (Build 2600)
> Exit Time: 1:00 am, Monday, January 1 1601
> Elapsed Time: 0:00:35.208
> Process Time: 0:00:05.822
> System Calls: 659366
> Context Switches: 138074
> Page Faults: 61507
> Bytes Read: 80719977
> Bytes Written: 320584
> Bytes Other: 908395
>
>
> Average for without-select key over 3 runs
>
> Version Number: Windows NT 5.1 (Build 2600)
> Exit Time: 1:00 am, Monday, January 1 1601
> Elapsed Time: 0:00:33.796
> Process Time: 0:00:06.166
> System Calls: 857893
> Context Switches: 140154
> Page Faults: 69061
> Bytes Read: 99353998
> Bytes Written: 2017152
> Bytes Other: 1175082
The times look comparable, but I'm confused why byte counts are so
much different. Is there a good explanation to that?
Anyway, AFAIU, your tests indicate that it would be okay to install
the above changes on the development trunk, right?
Thanks for your valuable feedback.
next prev parent reply other threads:[~2013-02-22 12:36 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-16 11:38 Calling 'select' from emacs_gnutls_pull Eli Zaretskii
2013-02-16 15:55 ` Ted Zlatanov
2013-02-16 16:52 ` Eli Zaretskii
2013-02-16 18:00 ` Ted Zlatanov
2013-02-16 19:30 ` Eli Zaretskii
2013-02-17 13:20 ` Ted Zlatanov
2013-02-22 11:15 ` Claudio Bley
2013-02-22 12:36 ` Eli Zaretskii [this message]
2013-02-22 15:17 ` Claudio Bley
2013-02-22 16:02 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83ehg8mso1.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=claudio.bley@gmail.com \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.