Locking in the resource manager
The resource manager framework provides facilities for safe thread synchronization in your resource manager. Before you write a multi-threaded resource manager, make sure you are familiar with the default behavior of the shared data structures that thread synchronization uses and the requirements for safely overriding them.
Extending the attributes structure
You may wish to extend the attributes structure in cases where you need to store additional device information. Since the attributes structure is associated on a per-device basis, this means that any extra information you store there will be accessible to all OCBs that reference that device (since the OCB contains a pointer to the attributes structure). Often things like serial baud rate, etc. are stored in extended attributes structures.
Blocking within the resource manager
So far we've avoided talking about blocking within the resource manager. We assume that you will supply an outcall function (e.g., a read I/O function handler), and that the data will be available immediately. What if you need to block, waiting for the data? For example, performing a read() on the serial port might need to block until a character arrives. Obviously, we can't predict how long this will take.
Returning directory entries
In the example for the read I/O function handler above, we saw how to return data. As mentioned in the description of the read I/O function handler (in the Alphabetical listing of Connect and I/O functions), the read I/O function handler may return directory entries as well. Since this isn't something that everyone will want to do, I discuss it here.