272 |
#define READ_OUTPUT_DELAY_MAX (READ_OUTPUT_DELAY_INCREMENT * 5) |
#define READ_OUTPUT_DELAY_MAX (READ_OUTPUT_DELAY_INCREMENT * 5) |
273 |
#define READ_OUTPUT_DELAY_MAX_MAX (READ_OUTPUT_DELAY_INCREMENT * 7) |
#define READ_OUTPUT_DELAY_MAX_MAX (READ_OUTPUT_DELAY_INCREMENT * 7) |
274 |
|
|
275 |
/* Number of processes which might be delayed. */ |
/* Number of processes which have a non-zero read_output_delay, |
276 |
|
and therefore might be delayed for adaptive read buffering. */ |
277 |
|
|
278 |
static int process_output_delay_count; |
static int process_output_delay_count; |
279 |
|
|
280 |
/* Non-zero if any process has non-nil process_output_skip. */ |
/* Non-zero if any process has non-nil read_output_skip. */ |
281 |
|
|
282 |
static int process_output_skip; |
static int process_output_skip; |
283 |
|
|
284 |
/* Non-nil means to delay reading process output to improve buffering. |
/* Non-nil means to delay reading process output to improve buffering. |
285 |
A value of t means that delay is reset after each send, any other |
A value of t means that delay is reset after each send, any other |
286 |
non-nil value does not reset the delay. */ |
non-nil value does not reset the delay. A value of nil disables |
287 |
|
adaptive read buffering completely. */ |
288 |
static Lisp_Object Vprocess_adaptive_read_buffering; |
static Lisp_Object Vprocess_adaptive_read_buffering; |
289 |
#else |
#else |
290 |
#define process_output_delay_count 0 |
#define process_output_delay_count 0 |
4321 |
#endif |
#endif |
4322 |
|
|
4323 |
#ifdef ADAPTIVE_READ_BUFFERING |
#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. */ |
4329 |
if (process_output_skip && check_delay > 0) |
if (process_output_skip && check_delay > 0) |
4330 |
{ |
{ |
4331 |
int usecs = EMACS_USECS (timeout); |
int usecs = EMACS_USECS (timeout); |
4336 |
proc = chan_process[channel]; |
proc = chan_process[channel]; |
4337 |
if (NILP (proc)) |
if (NILP (proc)) |
4338 |
continue; |
continue; |
4339 |
|
/* Find minimum non-zero read_output_delay among the |
4340 |
|
processes with non-nil read_output_skip. */ |
4341 |
if (XINT (XPROCESS (proc)->read_output_delay) > 0) |
if (XINT (XPROCESS (proc)->read_output_delay) > 0) |
4342 |
{ |
{ |
4343 |
check_delay--; |
check_delay--; |
6720 |
#endif /* HAVE_SOCKETS */ |
#endif /* HAVE_SOCKETS */ |
6721 |
|
|
6722 |
#if defined (DARWIN) || defined (MAC_OSX) |
#if defined (DARWIN) || defined (MAC_OSX) |
6723 |
/* PTYs are broken on Darwin < 6, but are sometimes useful for interactive |
/* PTYs are broken on Darwin < 6, but are sometimes useful for interactive |
6724 |
processes. As such, we only change the default value. */ |
processes. As such, we only change the default value. */ |
6725 |
if (initialized) |
if (initialized) |
6726 |
{ |
{ |