[comp.sys.amiga.tech] Help -- dos.library gurus when process is killed!

root@dialog.UUCP (Christian Motz) (09/17/89)

For some time now I have tried to implement a  kill-mechanism  similar
to the one used in UN*X on dear old Amy.  I  am  using  the  exception
mechanism provided by Exec.
   Everything works fine, I can send the "kill"-signal to the process,
the process suspends execution, enters the exception handling  routine
and exits -- or gurus. It *ALWAYS*  gurus  if  the  process  has  been
doing I/O when it was killed. But it is not really the process  itself
that gurus, but dos.library: it  reports  an  AN_AsyncPkt  (unexpected
packet received).
   Up to now I have tried several  things  to  prevent  this  kind  of
behaviour, but so far I haven't been successful. What  is  it  I  have
overlooked? I would greatly appreciate any pointers on how to get  rid
of this problem.

--
Christian Motz           uucp: ...!uunet!mcvax!unido!nadia!dialog!root
"Trust me, I know what I'm doing!" -- Sledge Hammer         Bix: cmotz

dillon@POSTGRES.BERKELEY.EDU (Matt Dillon) (09/18/89)

:For some time now I have tried to implement a  kill-mechanism  similar
:to the one used in UN*X on dear old Amy.  I  am  using  the  exception
:mechanism provided by Exec.
:   Everything works fine, I can send the "kill"-signal to the process,
:the process suspends execution, enters the exception handling  routine
:and exits -- or gurus. It *ALWAYS*  gurus  if  the  process  has  been
:doing I/O when it was killed. But it is not really the process  itself
:that gurus, but dos.library: it  reports  an  AN_AsyncPkt  (unexpected
:packet received).
:   Up to now I have tried several  things  to  prevent  this  kind  of
:behaviour, but so far I haven't been successful. What  is  it  I  have
:overlooked? I would greatly appreciate any pointers on how to get  rid
:of this problem.

	Because the current implementation of the send-wait packet function
    for DOS only allows once packet to be pending for a process at a time.
    When you enter the exception handler, interrupting an IO operation, and
    then try to do another IO operation on top of it, *poof*.

	Um, I would give up.  There is no way to do it properly asynchronously.

	Not only DOS, but you can't go interrupt arbitrary library calls
    in the middle of their execution!  Think of a graphics.library call
    that gets interrupted!

					-Matt