all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Po Lu <luangruo@yahoo.com>
To: Robert Pluim <rpluim@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: 1024 file descriptors should be enough for anyone
Date: Thu, 05 May 2022 08:55:10 +0800	[thread overview]
Message-ID: <87pmkslrwx.fsf@yahoo.com> (raw)
In-Reply-To: <874k25726k.fsf@gmail.com> (Robert Pluim's message of "Wed, 04 May 2022 17:22:27 +0200")

Robert Pluim <rpluim@gmail.com> writes:

> Attached an initial attempt at using poll() instead of select(), and
> bumping the open filed descriptor limit to 10240. It passes 'make
> check' on GNU/Linux, FreeBSD 13, and macOS, and M-x eww
> works. MS-Windows should still build with no change in functionality.

Great, thanks!  Though would prefer `syspoll.h' to be part of
`sysselect.h' instead, since it just defines a wrapper that pretends to
be `pselect'.  It also means we can get rid of the following
incantation:

> +#ifdef USE_POLL
> +#include "syspoll.h"
> +#endif

Some more comments below:

> +  Does Emacs use poll()?                                  ${USE_POLL}

> +** Emacs can now use poll() and larger file descriptor sets.
> +There is experimental support for using poll() instead of select() to
> +check file descriptor statuses, which can be requested by using the
> +'--with-poll' option to the 'configure' script.  As part of this
> +feature, the maximum number of open files supported has been increased
> +to 10xFD_SETSIZE (which is typically 1024).  Note that there may be
> +ulimit or kernel limits that still restrict the number of simultaneous
> +open files.  This feature is not supported on MS-Windows.

In here and various other places, "poll()" should be written `poll',
since it is not a function call without arguments.

> diff --git a/src/xterm.c b/src/xterm.c
> index 01832d60c9..3576267626 100644
> --- a/src/xterm.c
> +++ b/src/xterm.c
> @@ -637,6 +637,9 @@ Copyright (C) 1989, 1993-2022 Free Software Foundation, Inc.
>  #include "font.h"
>  #include "xsettings.h"
>  #include "sysselect.h"
> +#ifdef USE_POLL
> +#include "syspoll.h"
> +#endif
>  #include "menu.h"
>  #include "pdumper.h"

init_xterm must reject displays whose fds are larger than FD_MAXSIZE on
Lucid and Motif builds, since Xt uses pselect internally.  (I don't
remember if XtOpenDisplay does that for you anymore.)

I would prefer that x_wait_for_event, XTflash and
x_next_event_from_any_display be rewritten to utilize poll directly
instead of going through the wrapper as well.

Once again, thanks for making this happen!



  reply	other threads:[~2022-05-05  0:55 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-04 15:22 1024 file descriptors should be enough for anyone Robert Pluim
2022-05-05  0:55 ` Po Lu [this message]
2022-05-05  2:51   ` Po Lu
2022-05-05  7:09   ` Robert Pluim
2022-05-06  8:28     ` Robert Pluim
2022-05-06  8:54       ` Po Lu
2022-05-06  9:02         ` Robert Pluim
2022-05-06  9:28           ` Po Lu
2022-05-06  9:31             ` Robert Pluim
2022-05-06 10:41               ` Po Lu
2022-05-06 12:21                 ` Robert Pluim
2022-05-06 13:04                   ` Po Lu
2022-05-06 13:20                     ` Po Lu
2022-05-06 16:41                       ` Robert Pluim
2022-05-05  2:11 ` Surprisingly high use of file descriptors Stefan Monnier
2022-05-05  7:13   ` Robert Pluim
2022-05-05  7:47     ` Eli Zaretskii
2022-05-05  7:51       ` Robert Pluim
2022-05-05  8:20         ` Eli Zaretskii
2022-05-05  8:25           ` Robert Pluim
2022-05-05 11:35 ` 1024 file descriptors should be enough for anyone Lars Ingebrigtsen
2022-05-05 12:30   ` Robert Pluim
2022-05-05 13:12     ` Lars Ingebrigtsen
2022-05-05 13:45       ` Robert Pluim
2022-05-24 23:50         ` Lars Ingebrigtsen
2022-05-25 15:30           ` Robert Pluim

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=87pmkslrwx.fsf@yahoo.com \
    --to=luangruo@yahoo.com \
    --cc=emacs-devel@gnu.org \
    --cc=rpluim@gmail.com \
    /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.