different Resource Manage implementations

Hi

We just started developing with qnx. Now we are trying to write a
resource manager. For this we have to sources of information. The
Article at
http://www.qnx.com/developer/docs/momentics621_docs/neutrino/prog/resmgr.html
and the Book about QNX Neutrino 2 from Rob Krten. The Problem ist that
the example presented in the book and on the website are different.

Can someone please describe the differences in a few simple words? Is
one of the code outdated?

thanks allot

jan

For example the book initializes the resmgr with:

/* allocate a context structure /
ctp = resmgr_context_alloc(dpp);

but in the article the function used is

/
allocate a context structure */
ctp = dispatch_context_alloc(dpp);

also the way the resmgr send messages to the client is very different in
the book it is done with:

MsgReply(ctp->rcvid, nbytes, dataString + off, nbytes);

but int the article it is done via IOV:

/* set up the return data IOV */
SETIOV (ctp->iov, buffer + ocb->offset, nbytes);

where the buffer must be global an d static.

“Jan Rüdiger” <ruediger@uni-mannheim.de> wrote in message
news:bb1uvu$sa4$1@inn.qnx.com

Hi

We just started developing with qnx. Now we are trying to write a
resource manager. For this we have to sources of information. The
Article at

http://www.qnx.com/developer/docs/momentics621_docs/neutrino/prog/resmgr.html
and the Book about QNX Neutrino 2 from Rob Krten. The Problem ist that
the example presented in the book and on the website are different.

Can someone please describe the differences in a few simple words? Is
one of the code outdated?

thanks allot

jan

For example the book initializes the resmgr with:
snip
/* allocate a context structure /
ctp = resmgr_context_alloc(dpp);
/snip
but in the article the function used is
snip
/
allocate a context structure */
ctp = dispatch_context_alloc(dpp);
/snip

dispatch fonction provides same fonctionnality as resmgr + support for other
feature like pulse_attach, message_attach.

also the way the resmgr send messages to the client is very different in
the book it is done with:
snip
MsgReply(ctp->rcvid, nbytes, dataString + off, nbytes);
/snip
but int the article it is done via IOV:
snip
/* set up the return data IOV */
SETIOV (ctp->iov, buffer + ocb->offset, nbytes);
/snip
where the buffer must be global an d static.

SETIOV is a macro that set thing up to let the resmgr framework do the reply
for you.