diff options
| author | Kim F. Storm | 2005-06-07 13:19:25 +0000 |
|---|---|---|
| committer | Kim F. Storm | 2005-06-07 13:19:25 +0000 |
| commit | db853b7a753cb38f082d26036a92b8982aeb5bf1 (patch) | |
| tree | a353317a5cef85102dfd39bcf87e9458b15c025c /src | |
| parent | 8b793bed5341add3be4ece580ace65dfd5aa24bf (diff) | |
| download | emacs-db853b7a753cb38f082d26036a92b8982aeb5bf1.tar.gz emacs-db853b7a753cb38f082d26036a92b8982aeb5bf1.zip | |
Improve commentary for adaptive read buffering.
Diffstat (limited to 'src')
| -rw-r--r-- | src/process.c | 17 |
1 files changed, 13 insertions, 4 deletions
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; | |||
| 272 | #define READ_OUTPUT_DELAY_MAX (READ_OUTPUT_DELAY_INCREMENT * 5) | 272 | #define READ_OUTPUT_DELAY_MAX (READ_OUTPUT_DELAY_INCREMENT * 5) |
| 273 | #define READ_OUTPUT_DELAY_MAX_MAX (READ_OUTPUT_DELAY_INCREMENT * 7) | 273 | #define READ_OUTPUT_DELAY_MAX_MAX (READ_OUTPUT_DELAY_INCREMENT * 7) |
| 274 | 274 | ||
| 275 | /* Number of processes which might be delayed. */ | 275 | /* Number of processes which have a non-zero read_output_delay, |
| 276 | and therefore might be delayed for adaptive read buffering. */ | ||
| 276 | 277 | ||
| 277 | static int process_output_delay_count; | 278 | static int process_output_delay_count; |
| 278 | 279 | ||
| 279 | /* Non-zero if any process has non-nil process_output_skip. */ | 280 | /* Non-zero if any process has non-nil read_output_skip. */ |
| 280 | 281 | ||
| 281 | static int process_output_skip; | 282 | static int process_output_skip; |
| 282 | 283 | ||
| 283 | /* Non-nil means to delay reading process output to improve buffering. | 284 | /* Non-nil means to delay reading process output to improve buffering. |
| 284 | A value of t means that delay is reset after each send, any other | 285 | A value of t means that delay is reset after each send, any other |
| 285 | non-nil value does not reset the delay. */ | 286 | non-nil value does not reset the delay. A value of nil disables |
| 287 | adaptive read buffering completely. */ | ||
| 286 | static Lisp_Object Vprocess_adaptive_read_buffering; | 288 | static Lisp_Object Vprocess_adaptive_read_buffering; |
| 287 | #else | 289 | #else |
| 288 | #define process_output_delay_count 0 | 290 | #define process_output_delay_count 0 |
| @@ -4319,6 +4321,11 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display, | |||
| 4319 | #endif | 4321 | #endif |
| 4320 | 4322 | ||
| 4321 | #ifdef ADAPTIVE_READ_BUFFERING | 4323 | #ifdef ADAPTIVE_READ_BUFFERING |
| 4324 | /* Set the timeout for adaptive read buffering if any | ||
| 4325 | process has non-nil read_output_skip and non-zero | ||
| 4326 | read_output_delay, and we are not reading output for a | ||
| 4327 | specific wait_channel. It is not executed if | ||
| 4328 | Vprocess_adaptive_read_buffering is nil. */ | ||
| 4322 | if (process_output_skip && check_delay > 0) | 4329 | if (process_output_skip && check_delay > 0) |
| 4323 | { | 4330 | { |
| 4324 | int usecs = EMACS_USECS (timeout); | 4331 | int usecs = EMACS_USECS (timeout); |
| @@ -4329,6 +4336,8 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display, | |||
| 4329 | proc = chan_process[channel]; | 4336 | proc = chan_process[channel]; |
| 4330 | if (NILP (proc)) | 4337 | if (NILP (proc)) |
| 4331 | continue; | 4338 | continue; |
| 4339 | /* Find minimum non-zero read_output_delay among the | ||
| 4340 | processes with non-nil read_output_skip. */ | ||
| 4332 | if (XINT (XPROCESS (proc)->read_output_delay) > 0) | 4341 | if (XINT (XPROCESS (proc)->read_output_delay) > 0) |
| 4333 | { | 4342 | { |
| 4334 | check_delay--; | 4343 | check_delay--; |
| @@ -6711,7 +6720,7 @@ init_process () | |||
| 6711 | #endif /* HAVE_SOCKETS */ | 6720 | #endif /* HAVE_SOCKETS */ |
| 6712 | 6721 | ||
| 6713 | #if defined (DARWIN) || defined (MAC_OSX) | 6722 | #if defined (DARWIN) || defined (MAC_OSX) |
| 6714 | /* PTYs are broken on Darwin < 6, but are sometimes useful for interactive | 6723 | /* PTYs are broken on Darwin < 6, but are sometimes useful for interactive |
| 6715 | processes. As such, we only change the default value. */ | 6724 | processes. As such, we only change the default value. */ |
| 6716 | if (initialized) | 6725 | if (initialized) |
| 6717 | { | 6726 | { |