home *** CD-ROM | disk | FTP | other *** search
- io_torture.doc
-
- Io_torture is a tool which can be used to check for improper use
- or reuse of device IO requests.
-
- IO_torture should be part of the standard test suite for all products.
-
- Exec device IO usage is tracked by io_torture. If an IORequest is reused
- while still active, io_torture will print a warning message on the serial
- port (parallel for io_torture.par).
-
- Current plan of io_torture:
-
- SendIO() - Check that message is free. Check for ReplyPort.
- Be sure request is not linked into a list.
-
- BeginIO() - Check that message is free. Check for ReplyPort.
- Be sure request is not linked into a list.
-
- OpenDevice() - Mark message as free. If error, trash IO_DEVICE,
- IO_UNIT and LN_TYPE.
- Be sure request is not linked into a list.
-
- CloseDevice() - Check that message is free. Trash IO_DEVICE,
- IO_UNIT.
-
-
- Io_torture does not currently check for another common mistake:
- After virtually all uses of AbortIO(IORequest), there should be a
- call to WaitIO(IORequest). AbortIO() asks the device to finish
- the I/O as soon as possible; this may or may not happen instantly.
- AbortIO() does not wait for or remove the replied message.
-
- Note regarding NT_MESSAGE: NT_MESSAGE would seem to be the correct node
- type for an IO request which is newly initialized. However, part of
- how io_torture works is that it makes sure in-use requests are marked as
- NT_MESSAGE, and would normally complain if such an NT_MESSAGE came
- through BeginIO or SendIO (as it would signify reuse before ReplyMsg).
- So that io_torture will not complain about a freshly initialized
- MT_MESSAGE IO request, io_torture also checks to see if the message
- has ever been linked into a list. If it has not, io_torture will
- let the NT_MESSAAHE marked request by without complaining. This
- is necessary because the amiga.lib CreateExtIO and CreateStdIO
- historically set a newly created IO request node type to NT_MESSAGE.
-