summaryrefslogtreecommitdiff
path: root/test/lisp/vc/diff-mode-resources/git.patch
diff options
context:
space:
mode:
authorYue Yi <include_yy@qq.com>2025-03-11 00:30:40 +0800
committerEli Zaretskii <eliz@gnu.org>2025-03-14 14:58:42 +0200
commite02466a579a58fceda33ad51d822e39543bc883c (patch)
treee3f0c66277bf9f8a82516eb9b7565a7bb137f189 /test/lisp/vc/diff-mode-resources/git.patch
parent5d4056c7658d9a6c64267821bd56450e82de01cb (diff)
downloademacs-e02466a579a58fceda33ad51d822e39543bc883c.tar.gz
emacs-e02466a579a58fceda33ad51d822e39543bc883c.tar.bz2
emacs-e02466a579a58fceda33ad51d822e39543bc883c.zip
Increase FD_SETSIZE on Windows to support more subprocesses
Earlier versions of Emacs were limited to at most 32 subprocesses or network connections on Windows due to the 64-object limit imposed by WaitForMultipleObjects. To overcome this, a simple waiting thread pool is implemented, allowing Emacs to efficiently wait on up to 2048 objects. Each thread in the pool can wait on up to 63 objects, and a total of 32 threads are used, together with the main thread, to expand the waiting capability. This enables Emacs to support approximately 1024 subprocesses, which is comparable to the 'pty' method on GNU/Linux when using the default FD_SETSIZE of 1024. To minimize overhead, the threads remain active instead of being frequently created and destroyed, reducing unnecessary system resource consumption. Idle threads can be terminated after a period of inactivity to free up memory. * src/w32.h (FD_SETSIZE): Change from 64 to 2048. * src/w32.c (term_ntproc): Call 'free_wait_pool' to free waiting threads. * src/w32proc.c (WFO_ABANDONED, WFO_TIMEOUT, WFO_FAILED) (WFO_MAX_WAIT): New macros. (wait_objects_context, wait_objects_pool, wait_objects_info): New structures for managing the thread pool. (wait_objects_pool, wait_objects_info): New static variables for managing the thread pool. (wait_objects_thread, start_wait_objects, stop_wait_objects) (end_wait_and_return, shrink_wait_pool, free_wait_pool): New functions for waiting and managing the thread pool. (wait_for_objects, msg_wait_for_objects): New functions as replacements for WaitForMultipleObjects and MsgWaitForMultipleObjects. (wait_pid): Use 'wait_for_objects' and new macros. (sys_select): Make some variables static to avoid stack allocation. Use 'wait_for_objects', 'msg_wait_for_objects', and the new macros.
Diffstat (limited to 'test/lisp/vc/diff-mode-resources/git.patch')
0 files changed, 0 insertions, 0 deletions