Is it possible to run a native thread in an IIS platform app that has a C ++ app installed?
We are hosting a C ++ WebServices application in IIS and we find that when we try to start our own C ++ threads, IIS has fit and crashes. Threads are based on boost.thread, which explicitly goes down to the standard Windows threading API.
The reason I need to start streaming is listening to multicasts from our mid-tier server to update the local cache. If you don't write another process to listen to us, I'm at a loss what else I can do.
So the question is, should this work? Are there any restrictions on this kind of operation with IIS?
source to share
It looks like you are creating a persistent thread that lives longer than the lifespan of the request that initiates it. You don't mention, it's ASP.NET C ++ / CLI, Managed C ++, or an extension or ISAPI filter, or even CGI.
Conceptually, the code that is called by IIS should only "live" for the lifetime of the request. Code that lasts longer will be dominated by IIS recycling for application pools.
Your best bet is to have another process that listens for notifications and maintain a cache in that process. Then you can use shared memory (see Boost.Interprocess ) to access that cache from your web service.
source to share