David Gibbs <dagibbs@qnx.com> wrote:
DG > alpha <alpha1@takas.lt> wrote:
Hello,
I have no general knowledge on layers of resource manager. There are
four layers, but do I need to use all of them? Is there any difference
between what level will be created first and so on. What is the
different between resmgr and dispatch layers and why multithreaded
resource managers can use one of them?
Think this question isn’t clear, but maybe you can give me some advices
except of buying books.
DG > Well, I guess I can’t suggest buying and reading Rob Krten’s (very good)
DG > books on programming for QNX Neutrino.
DG > So, first, have you read the chapter in the Programmer’s Guide of the QNX
DG > documentation on writing a resource manager?
DG > It does talk about the four layers – but I think it has its layers
DG > upside down. I’d describe them, top to bottom, as:
DG > thread_pool layer - optional, only needed for multi-threaded resmgrs,
DG > gives a dynamic thread pool
DG > dispatch layer - optional, but usual. Extends resoure manager from
DG > handling just IO messages to handling pulses, non-IO messages, and
DG > select on some other server
DG > resmgr layer – the main attach, block, and handling functions – the
DG > core structure of the resource manager framework
DG > io funcs layer – default handlers for all IO messages, and the helper
DG > functions they use, and that you can and should use, for handling most
DG > messages in a POSIX way.
DG > In general, you will replace some of the iofuncs layer (e.g. read and
DG > write handling) with your functions, and use pieces of the iofunc layer
DG > to help you implement your handlers. You’ll use the resmgr layer for
DG > initialization, and also through the dispatch layer which will also be
DG > used for initialization and the main loop of your program.
DG > -David
DG > –
DG > David Gibbs
DG > QNX Training Services
DG > dagibbs@qnx.com
Very good explanation. I wish the docs were as clear.