Path: utzoo!attcan!uunet!lll-winken!lll-tis!helios.ee.lbl.gov!pasteur!ucbvax!CORY.BERKELEY.EDU!dillon From: dillon@CORY.BERKELEY.EDU (Matt Dillon) Newsgroups: comp.sys.amiga Subject: Re: Modem/VT100 problem Message-ID: <8806180105.AA07445@cory.Berkeley.EDU> Date: 18 Jun 88 01:05:37 GMT Sender: daemon@ucbvax.BERKELEY.EDU Lines: 37 :I know that there are a number of places within vt100 where it will :AbortIO() a request, :Wait() for the signal associated with the port for that IO request, then :WaitIO() on that IO request. :This sequence can lead to obscure vt100 lock-ups if the IO happens to :complete and the signal is cleared somewhere else in the program before :this code gets executed. However, this only causes vt100 to hang, not :any other part of the system, and it's fairly rare and timing dependent. :I took all the Wait()'s out of these sequences after I was burned a few :times aborting scripts, and have had no problems with vt100 hanging :since then. Hopefully I'll remember to complain to Tony before the :next version comes out. The only possible way this could cause a lock up is if the signal got cleared AFTER the IO request completed but BEFORE the Wait(). AbortIO() itself does not munge with the signals. The only way the signal can be cleared is if VT100 clears it somewhere (via Wait(), for instance). Thus, the bug is in *ANOTHER PART* of VT100. Besides all that there is absolutely no reason to put a Wait() before WaitIO(). WaitIO() works no matter what the state of the signal bit is. A common problem which you might look for is the programmer forgetting set the node type of the IO request to NT_MESSAGE before SendIO(), BeginIO(), or DoIO() (not sure about needing it in DoIO()). PutMsg() does this for you, but SendIO()/BeginIO()/DoIO() usually don't (it depends on the device). Just as PutMsg() sticks in NT_MESSAGE automatically, ReplyMsg() sticks in NT_REPLYMSG or NT_FREEMSG automatically. This is how WaitIO() figures out whether the request has been returned by the device yet or not. (IOF_QUICK is also checked but that's another story). Since one doesn't PutMsg() to the IO device, one must set ln_Type to NT_MESSAGE manually before every SendIO()/BeginIO()/DoIO(). -Matt