Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!sdd.hp.com!mips!public!valentin From: valentin@public.BTR.COM (Valentin Pepelea) Newsgroups: comp.sys.amiga.programmer Subject: Re: Question on AbortIO() and WaitIO() Message-ID: <2865@public.BTR.COM> Date: 23 May 91 07:45:32 GMT References: <28630@uflorida.cis.ufl.EDU> Organization: BTR Communications, Mtn. View, CA Lines: 47 In article <28630@uflorida.cis.ufl.EDU> leh@otter.cis.ufl.edu (Les Hill) writes: > > /* Clean up */ > if (!CheckIO(read_req)) { > AbortIO(read_req); > if (dev_error = WaitIO(read_req)) { > printf("Error waiting for aborted read -- %d\n", dev_error); > goto cleanup_8; > } > read_msg = GetMsg(read_port); // not necessary? > } >... > >The situation is this: a CMD_READ request *should* be queued at the device >(the CheckIO() should confirm this), Not really. The IO request could have been processed between the time ChechIO was called and AbortIO is about to be. >The question that comes to mind is: does WaitIO() dequeue the reply at >read_port (read_port is the reply port for read_req) regardless of the error? Yes, WaitIO() makes sure the message is dequeued. >Additionally, do I need the GetMsg()? No you don't. This is a bug. The line: > read_msg = GetMsg(read_port); // not necessary? should have read > else read_msg = GetMsg(read_port) However, you should note the the best method to perform the given operation is simply: AbortIO(IORequest); WaitIO(IORequest); If the IORequest had already completed, then AbortIO does nothing. Valentin -- "An operating system without virtual memory Name: Valentin Pepelea is an operating system without virtue." Phone: (408) 985-1700 Usenet: mips!btr!valentin - Ancient Inca Proverb Internet: valentin@btr.com