Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - resource manager, ionotify, 2 clients, RESOURCE BUSY: (4 Items)
   
resource manager, ionotify, 2 clients, RESOURCE BUSY  
Hi all,

I followed the QNX documentation about implementing support for ionotify in a resource manager. It all works fine for 
the first client connecting to the resource manager but the second client always receives "resource busy". The 
documentation at http://www.qnx.com/developers/docs/6.4.1/neutrino/lib_ref/i/iofunc_notify.html states: "A notification 
was already armed for this resource, and this library function enforces a restriction of one per resource." And this is 
where I'm lost. The documentation at 
http://www.qdn.com/developers/docs/6.4.0/neutrino/prog/resmgr.html#HANDLING_ionotify seens to tell me that I can use 
ionotify with multiple clients. The term 'resource', is that the server or client.

A few years ago, I ran into this issue also and at that moment, a guy named Roverfan showed me to add the notify 
structure to the OCB and implement a per client OCB. (http://www.openqnx.com/index.php?name=PNphpBB2&file=printview&t=
2927&start=0)

My questions: How to make ionotify work in a resource manager for multiple clients and how to trigger all clients from a
 resource manager worker thread.

TIA,
Freddy



Regards,
Freddy Martens
Re: resource manager, ionotify, 2 clients, RESOURCE BUSY  
I did more testing and this is what I found out:
The resource manager works with 2 photon applications using PtAppAddFd. I see that io_notify (in the RM) is called for 
both clients doing a PtAppAddFd and that io_notify does not return an error.

My console application works fine using a select, it responds that data is available to read but calling ionotify 
results in a EBUSY.

My question is: why does the call to notify return an EBUSY and why does select succeed. They both call io_notify in the
 resource manager.

Regards,
Freddy
Re: resource manager, ionotify, 2 clients, RESOURCE BUSY  
Found it. I did not read the complete documentation about _NOTIFY_ACTION_TRANARM.

It was perfectly documented at: http://www.qnx.com/developers/docs/6.4.1/neutrino/lib_ref/i/ionotify.html

The doc states:
Note that for transition arming (as specified by an action of _NOTIFY_ACTION_TRANARM, only one notification of that type
 can be outstanding per device. When the transition arm fires, it's removed.

PS: Could QSSL update the documentation at the given URL? The EBUSY is not documented.
RE: resource manager, ionotify, 2 clients, RESOURCE BUSY  
We've already added EBUSY to the docs for ionotify() in 6.5.0:

EBUSY
    A notification was already armed for this resource; this function
enforces a restriction of one per message queue or resource manager. 

Nevertheless, thanks for the suggestion.

Steve Reid (stever@qnx.com)
Technical Editor
QNX Software Systems