emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 1024 file descriptors should be enough for anyone


From: Po Lu
Subject: Re: 1024 file descriptors should be enough for anyone
Date: Thu, 05 May 2022 08:55:10 +0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.91 (gnu/linux)

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 via email to

[Prev in Thread] Current Thread [Next in Thread]