Operation begins in the usual manner with main() in main.c. We call our option processor (optproc()) and then we enter the resource manager main loop at execute_resmgr(). The resource manager main loop never returns.

All of the work is done as callouts by the connect and I/O functions of the resource manager. We take over the io_open(), io_read(), and io_close_ocb() functions, and leave all the rest to the QNX Neutrino libraries. This makes sense when you think about it—apart from the magic of generating a graphical image on-the-fly, all we're really doing is handling the client's open() (so we can set up our data areas), giving the data to the client (via the client's read()), and cleaning up after ourselves (when we get the client's close()).

However, as you'll see shortly, even these simple operations have some interesting consequences that need to be considered.