[comp.sys.amiga] Libraries vs Devices

page@ulowell.cs.ulowell.edu (Bob Page) (01/06/88)

jimm@amiga.UUCP (Jim Mackraz) wrote:
>Intuition is not a device, it is a library.  You interface to it
>by function calls, not by sending a request block.  So there is
>no standard way to choose whether you want to wait until it's done
>or check later if it's done.

I did it once, for a custom device.  The device was programmed like a
re-entrant library, so the programmer didn't have to know about
request blocks.  By default, everything was synchronous.  If the
programmer wanted some particular part to be async, she just had to
add another parameter to the library call, which was the reply port.

In other words, if we saw a NULL reply port, we kept control until the
job was done, otherwise we'd return right away and send a message to
the specified reply port when we finished the request.

This was for computer control of A/V equipment like VCRs, where you
had commands like "stop" "rewind" and "stop at counter 3456" this
allowed the program to stack/queue commands to the device (kinda made
14-day/4-event programming look sick) while having the simplicity of a
library.

Hackity hack -

..Bob
-- 
Bob Page, U of Lowell CS Dept.  page@ulowell.edu  ulowell!page
"I've never liked reality all that much, but I haven't found a
better solution."		--Dave Haynie, Commodore-Amiga