all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Accepting process output from a given process only?
@ 2004-08-06 12:08 Milan Zamazal
  0 siblings, 0 replies; 3+ messages in thread
From: Milan Zamazal @ 2004-08-06 12:08 UTC (permalink / raw)


I'd like to receive output from an asynchronous process, but without
possible invocation of other asynchronous actions.  If I simply call
accept-process-output, other process filter functions or timers may be
invoked at that time, which is what I need to avoid.

Is there a way to read an output of just a given single asynchronous
process?  If it is not, would it be possible/feasible to implement such
a function for Emacs (I might do it if it is not too complicated)?

Thanks for any advice.

Milan Zamazal

-- 
Wasting somebody else's time strikes me as the height of rudeness.
						      Bill Gates

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Accepting process output from a given process only?
       [not found] <mailman.136.1091795084.2011.help-gnu-emacs@gnu.org>
@ 2004-08-06 22:45 ` Stefan Monnier
  2004-08-08 18:47   ` Milan Zamazal
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Monnier @ 2004-08-06 22:45 UTC (permalink / raw)


> I'd like to receive output from an asynchronous process, but without
> possible invocation of other asynchronous actions.  If I simply call
> accept-process-output, other process filter functions or timers may be
> invoked at that time, which is what I need to avoid.

There's no such feature.  Could you explain what you need it for
(i.e. why it is bad to process other processes's output at the same point
in the program)?


        Stefan

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Accepting process output from a given process only?
  2004-08-06 22:45 ` Stefan Monnier
@ 2004-08-08 18:47   ` Milan Zamazal
  0 siblings, 0 replies; 3+ messages in thread
From: Milan Zamazal @ 2004-08-08 18:47 UTC (permalink / raw)


>>>>> "SM" == Stefan Monnier <monnier@iro.umontreal.ca> writes:

    >> I'd like to receive output from an asynchronous process, but
    >> without possible invocation of other asynchronous actions.  If I
    >> simply call accept-process-output, other process filter functions
    >> or timers may be invoked at that time, which is what I need to
    >> avoid.

    SM> There's no such feature.  Could you explain what you need it for
    SM> (i.e. why it is bad to process other processes's output at the
    SM> same point in the program)?

I write an Emacs speech output system, which communicates with a speech
synthesis system via a network process.  The problem is that, due to
possible multiple process processing in accept-process-output, many
process filter functions must be reentrant.

Imagine the following (real) scenario: Some Emacs command, let's say
foo, opens a network connection, reads data from the socket and reports
progress to the user via `message' in its filter function.  The
`message' function is, naturally, advised by the speech output system,
which talks to the synthesizer and reads its answer immediately, i.e. it
calls accept-process-output.  But the accept-process-output call may
invoke foo's filter function again, i.e. the foo's filter function is
invoked within its previous invocation.  If the foo's filter function is
not reentrant, foo may end up with an error.

If I could call accept-process-output in the speech output system
without the danger of other filter function and/or timer invocation,
then foo would be safe.  Moreover, the speech output system needn't be
reentrant itself, so it could be simplified.

Regards,

Milan Zamazal

-- 
The rush to reproduce Microsofts window environment seems to overshadow the
design process of determining what a window environment should be, and what its
ultimate users will want.                  -- Barry Fishman in gnu.misc.discuss

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-08-08 18:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-06 12:08 Accepting process output from a given process only? Milan Zamazal
     [not found] <mailman.136.1091795084.2011.help-gnu-emacs@gnu.org>
2004-08-06 22:45 ` Stefan Monnier
2004-08-08 18:47   ` Milan Zamazal

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.