Concurrency question

Christian Henz <[email protected]> Fri, 27 Jan 2006 18:40:58 +0100
Newsgroups gmane.linux.upnp-sdk.general
Message-ID <[email protected]>
Hello!

I am a little confused about what i can and cannot do from a callback.
I'm writing a control point application btw.

The reference manual states:

    "The Linux SDK for UPnP Devices contains functions that generate  asynchronous callbacks.
To simplify the application callback functions, these callbacks are executed on a thread owned
by the SDK itself. The SDK executes the application’s callback function in a thread context so
the application can allocate memory and preserve the information it needs. The application can
also use standard thread synchronization methods to ensure data integrity. Due to the possibility
of deadlock, the application cannot call back into the SDK during these callbacks unless explic-
itly noted. [...]"

After some searching, I found only four functions which are explicitly allowed to be called during a callback:
- UpnpAcceptSubscription
- UpnpAcceptSubscriptionEx
- UpnpNotify
- UpnpNotify

So what about the others? The control point example calls from it's callback:
- UpnpSubscribe
- UpnpUnSubscribe
- UpnpDownloadXmlDoc, 
- UpnpResolveURL

None of these are explicitly allowed, so what's up with that? 

In my contol point application, on top of these functions I'm also calling UpnpAddToAction and UpnpSendAction from the callback. 
It seems to work so far, but is it legal?

Also, are there ever callbacks running concurrently? From the
passage above I would think not ("these callbacks are executed on a thread owned by the SDK"). Is this correct?
If so, I would not have to synchronize access to objects that are not touched 
from outside the callback between registering and unregistering my client?

thanks,
Christian Henz


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642