Wojtek Lerch
|
Re: Photon App/Resource Manager
|
Wojtek Lerch
05/27/2011 9:53 AM
post86202
|
Re: Photon App/Resource Manager
> Cool. Which event loop did you use?
You need both, each in its own thread(s).
Depending on what Photon features you try to use, it may just work, require some trickery, or be completely impossible.
In a nutshell, anything that makes the Photon library want a channel will conflict with the resource manager's channel.
If you search the docs for "name_attach() and PtAppAddInput()", you'll find a bit of an explanation of that conflict.
But the recommendation that works for name_attach() (let Photon use the channel created by name_attach()) doesn't work
for resource manager. You will really need two separate channels to run the two event loops. Since the kernel only
allows one channel per process to have the flags that both Photon and resmgr want, you'll have to cripple one of them.
The only one that has the API to allow you to cripple it is Photon -- you'll need to create a channel by hand, forcing
it *not* to have the flags that conflict with resmgr, and then pass it on to Photon. This will break some obscure
features of the Photon library, but hopefully you're not planning to use them in this project. :-(
|
|
|
Will Miles
|
Re: Photon App/Resource Manager
|
Will Miles
05/27/2011 4:25 PM
post86220
|
Re: Photon App/Resource Manager
We did as Wojtek described - we run two independent event loops. That said, we aren't using the actual resource
manager framework though; we use a custom dispatcher implementation with our own messaging protocol that is
architecturally similar but not the same. Consequently we don't run in to any problems with the per-process channel
flags, as our implementation doesn't need them.
|
|
|