From db853b7a753cb38f082d26036a92b8982aeb5bf1 Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Tue, 7 Jun 2005 13:19:25 +0000 Subject: Improve commentary for adaptive read buffering. --- src/process.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'src/process.c') diff --git a/src/process.c b/src/process.c index 5f756f4db05..bee61b5505a 100644 --- a/src/process.c +++ b/src/process.c @@ -272,17 +272,19 @@ int update_tick; #define READ_OUTPUT_DELAY_MAX (READ_OUTPUT_DELAY_INCREMENT * 5) #define READ_OUTPUT_DELAY_MAX_MAX (READ_OUTPUT_DELAY_INCREMENT * 7) -/* Number of processes which might be delayed. */ +/* Number of processes which have a non-zero read_output_delay, + and therefore might be delayed for adaptive read buffering. */ static int process_output_delay_count; -/* Non-zero if any process has non-nil process_output_skip. */ +/* Non-zero if any process has non-nil read_output_skip. */ static int process_output_skip; /* Non-nil means to delay reading process output to improve buffering. A value of t means that delay is reset after each send, any other - non-nil value does not reset the delay. */ + non-nil value does not reset the delay. A value of nil disables + adaptive read buffering completely. */ static Lisp_Object Vprocess_adaptive_read_buffering; #else #define process_output_delay_count 0 @@ -4319,6 +4321,11 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display, #endif #ifdef ADAPTIVE_READ_BUFFERING + /* Set the timeout for adaptive read buffering if any + process has non-nil read_output_skip and non-zero + read_output_delay, and we are not reading output for a + specific wait_channel. It is not executed if + Vprocess_adaptive_read_buffering is nil. */ if (process_output_skip && check_delay > 0) { int usecs = EMACS_USECS (timeout); @@ -4329,6 +4336,8 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display, proc = chan_process[channel]; if (NILP (proc)) continue; + /* Find minimum non-zero read_output_delay among the + processes with non-nil read_output_skip. */ if (XINT (XPROCESS (proc)->read_output_delay) > 0) { check_delay--; @@ -6711,7 +6720,7 @@ init_process () #endif /* HAVE_SOCKETS */ #if defined (DARWIN) || defined (MAC_OSX) - /* PTYs are broken on Darwin < 6, but are sometimes useful for interactive + /* PTYs are broken on Darwin < 6, but are sometimes useful for interactive processes. As such, we only change the default value. */ if (initialized) { -- cgit v1.2.1 From 01836ccef042bfc40a71bb6a6cec44556ad0c34e Mon Sep 17 00:00:00 2001 From: Richard M. Stallman Date: Wed, 8 Jun 2005 15:18:10 +0000 Subject: (Fstart_process): Don't touch command_channel_p slot. --- src/process.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src/process.c') diff --git a/src/process.c b/src/process.c index bee61b5505a..d2d4390c501 100644 --- a/src/process.c +++ b/src/process.c @@ -1537,7 +1537,6 @@ usage: (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS) */) XPROCESS (proc)->childp = Qt; XPROCESS (proc)->plist = Qnil; - XPROCESS (proc)->command_channel_p = Qnil; XPROCESS (proc)->buffer = buffer; XPROCESS (proc)->sentinel = Qnil; XPROCESS (proc)->filter = Qnil; -- cgit v1.2.1 From 89f2614d96b5cf84f01c4903652a6a2b5b23d3d3 Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Wed, 8 Jun 2005 22:33:36 +0000 Subject: * composite.c (compose_chars_in_text): * eval.c (do_autoload): * macmenu.c (set_frame_menubar): * process.c (read_process_output, exec_sentinel): * xmenu.c (set_frame_menubar): * xdisp.c (prepare_menu_bars, update_menu_bar, update_tool_bar): * w32menu.c (set_frame_menubar): Use record_unwind_save_match_data. Rename restore_match_data to restore_search_regs. --- src/process.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/process.c') diff --git a/src/process.c b/src/process.c index d2d4390c501..0a4ee8aee46 100644 --- a/src/process.c +++ b/src/process.c @@ -4887,10 +4887,10 @@ read_process_output (proc, channel) { Lisp_Object tem; /* Don't clobber the CURRENT match data, either! */ - tem = Fmatch_data (Qnil, Qnil); - restore_match_data (); - record_unwind_protect (Fset_match_data, Fmatch_data (Qnil, Qnil)); - Fset_match_data (tem); + tem = Fmatch_data (Qnil, Qnil, Qnil); + restore_search_regs (); + record_unwind_save_match_data (); + Fset_match_data (tem, Qt); } /* For speed, if a search happens within this code, @@ -4944,7 +4944,7 @@ read_process_output (proc, channel) read_process_output_error_handler); /* If we saved the match data nonrecursively, restore it now. */ - restore_match_data (); + restore_search_regs (); running_asynch_code = outer_running_asynch_code; /* Handling the process output should not deactivate the mark. */ @@ -6348,10 +6348,10 @@ exec_sentinel (proc, reason) if (outer_running_asynch_code) { Lisp_Object tem; - tem = Fmatch_data (Qnil, Qnil); - restore_match_data (); - record_unwind_protect (Fset_match_data, Fmatch_data (Qnil, Qnil)); - Fset_match_data (tem); + tem = Fmatch_data (Qnil, Qnil, Qnil); + restore_search_regs (); + record_unwind_save_match_data (); + Fset_match_data (tem, Qt); } /* For speed, if a search happens within this code, @@ -6365,7 +6365,7 @@ exec_sentinel (proc, reason) exec_sentinel_error_handler); /* If we saved the match data nonrecursively, restore it now. */ - restore_match_data (); + restore_search_regs (); running_asynch_code = outer_running_asynch_code; Vdeactivate_mark = odeactivate; -- cgit v1.2.1 From 2de35a2582731182773e7689cee38780bddd7799 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Fri, 10 Jun 2005 14:19:26 +0000 Subject: (syms_of_process) [ADAPTIVE_READ_BUFFERING]: Fix spellings in docstrings. --- src/process.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/process.c') diff --git a/src/process.c b/src/process.c index 0a4ee8aee46..e7ea1bfe7df 100644 --- a/src/process.c +++ b/src/process.c @@ -6824,7 +6824,7 @@ The value takes effect when `start-process' is called. */); doc: /* If non-nil, improve receive buffering by delaying after short reads. On some systems, when Emacs reads the output from a subprocess, the output data is read in very small blocks, potentially resulting in very poor performance. -This behaviour can be remedied to some extent by setting this variable to a +This behavior can be remedied to some extent by setting this variable to a non-nil value, as it will automatically delay reading from such processes, to allowing them to produce more output before Emacs tries to read it. If the value is t, the delay is reset after each write to the process; any other -- cgit v1.2.1