emacs-devel
[Top][All Lists]
Advanced

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

Re: process.c changes causes problem with JDEbug of the JDE package


From: David Kastrup
Subject: Re: process.c changes causes problem with JDEbug of the JDE package
Date: 30 Jan 2004 11:42:40 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

Harald Maier <address@hidden> writes:

> address@hidden (Kim F. Storm) writes:
> 
> > Stefan Monnier <address@hidden> writes:
> >
> >> >>> Does it help to set process-adaptive-read-buffering to nil?
> >> 
> >> Harald> Yes, this helps an all works fine. Needs JDE to be changed
> >> Harald> about this issue?
> >> 
> >> > I will make the required change in the JDEE source code.  Thanks finding
> >> > a solution to this problem.
> >> 
> >> Please don't.  If process-adaptive-read-buffering needs to be set to nil,
> >> it just means that there's a problem with the adaptive-reading code.
> >> We want to fix *that* code rather than add some workaround in JDE.
> >
> > If there is a bug there, we should definitely try to fix it.
> >
> > However, conceptually, it is fully acceptable to let-bind
> > process-adaptive-read-buffering to nil around the call to
> > start-process for specific purposes.
> >
> > How is the process started?
> 
> It looks that the process is started by 'comint-exec'. Here a snippet
> from the jde-dbs.el. Afterwards it follows a call to accept-process-output.
> 
>   (save-w32-show-window
>    (comint-exec debugger-buffer debugger-buffer-name vm nil vm-args)
>    (setq debugger-process (get-process debugger-buffer-name))
>    (oset this process debugger-process)
>    (oset this buffer debugger-buffer)
>    (oset this comint-filter (process-filter debugger-process))
>    (jde-dbs-debugger-register-process-filter this 
> 'jde-dbs-asynch-output-listener)
>    )
>   ...
>   (if (not (accept-process-output debugger-process 
>    ...)))

Uh, accept-process-output does not guarantee that you get any output
that the process has not yet managed to produce.  This looks like
jde-dbs.el contains a definite race condition.

Unless at that point of time the process has already finished and
jde-dbs knows about that.  In that case there would be no point for
process-adaptive-read-buffering to hold back any input anymore.

Also it might be an idea to reset the timers for adaptive read
buffering not only when one is writing to the process, but also when
one is starting it, and of course after it has finished.

That way, typical interactive applications will never see an adverse
effect from adaptive read buffering.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum





reply via email to

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