Handling multiple hierarchy pathnames

I would like resource manager to handle multipe pathnames where in a
hierarchy path. For example, /proc/ipx/mode, /proc/ipx/cmd and
/proc/ipx/status, etc.

In QNX examples shows that resmgr_attach() can handle single pathname,
therefore, I think to handle three pathnames takes three threads each
call resmgr_attach() as below.

thread1
resmgr_attach(…, “/proc/ipx/mode”, …)
thread2
resmgr_attach(…, “/proc/ipx/cmd”, …)
thread3
resmgr_attach(…, “/proc/ipx/status”, …)

However, is it possible to use single thread to handle three or more
pathnames where they are hierarchy? For example,

resmgr_attach(…, “/proc/ipx”, …) where can handle
proc/ipx/mode, /proc/ipx/cmd and /proc/ipx/status?

asmart <tsunghsunwu@fpc.com-dot-tw.no-spam.invalid> wrote:

I would like resource manager to handle multipe pathnames where in a
hierarchy path. For example, /proc/ipx/mode, /proc/ipx/cmd and
/proc/ipx/status, etc.

In QNX examples shows that resmgr_attach() can handle single pathname,
therefore, I think to handle three pathnames takes three threads each
call resmgr_attach() as below.

You can call resmgr_attach() multiple times in one thread.

E.G.

thread1
resmgr_attach(…, “/proc/ipx/mode”, …)
resmgr_attach(…, “/proc/ipx/cmd”, …)
resmgr_attach(…, “/proc/ipx/status”, …)

However, is it possible to use single thread to handle three or more
pathnames where they are hierarchy? For example,

resmgr_attach(…, “/proc/ipx”, …) where can handle
proc/ipx/mode, /proc/ipx/cmd and /proc/ipx/status?

You could do this, but then you are also expected to handle /proc/ipx,
and return directory entries for the contents of /proc/ipx and other
messiness. (This would be a filesystem resource manager.)

If the number of entries you want to handle is small (less than 10-20) and
mostly static (it is not expected that users would be dynamically creating
entries, though the server might on hardware changes), then using multiple
attaches makes sense.

Whether they are done in one thread, or multiple, doesn’t really matter,
though if you want multiple threads in your server, it might be better to
have all the attaches done once, and then use a thread pool.

-David

David Gibbs
QNX Training Services
dagibbs@qnx.com