Accesing ICorRuntimeHost.
-
I'm trying to figure out: If there is anyway other then COM Interop to access ICorRuntimeHost interface implemented by running MSCOREE directly from managed application. Again, I'm not interested in possible solution that involves COM creation of CorRuntimeHost as it's not safe (or maybe it is?)... "...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..." Me
-
I'm trying to figure out: If there is anyway other then COM Interop to access ICorRuntimeHost interface implemented by running MSCOREE directly from managed application. Again, I'm not interested in possible solution that involves COM creation of CorRuntimeHost as it's not safe (or maybe it is?)... "...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..." Me
Igor, take a look at the System.AppDomain class. The Hosting Interface.doc paper from one of the subfolders of the .NET SDK is a good read too. If you are executing managed code, then a CLR instance is already started (for that app domain). That's probably why System.AppDomain doesn't provide methods like Start()/Stop(), contrary to ICorRuntimeHost.
-
Igor, take a look at the System.AppDomain class. The Hosting Interface.doc paper from one of the subfolders of the .NET SDK is a good read too. If you are executing managed code, then a CLR instance is already started (for that app domain). That's probably why System.AppDomain doesn't provide methods like Start()/Stop(), contrary to ICorRuntimeHost.
Stephane, Start/Stop is not of interest to me. I'm trying to figure out if it's possible to change MaxThreads in .NET ThreadPool class, which is static through safe .NET facilities. However, the only solution I've found so far is through COM Interop: http://www.csharphelp.com/archives3/archive487.html I don't get it: why SetMaxThreads is not exposed?: What a pain... "...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..." Me
-
Stephane, Start/Stop is not of interest to me. I'm trying to figure out if it's possible to change MaxThreads in .NET ThreadPool class, which is static through safe .NET facilities. However, the only solution I've found so far is through COM Interop: http://www.csharphelp.com/archives3/archive487.html I don't get it: why SetMaxThreads is not exposed?: What a pain... "...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..." Me
importing the COM signature seems to be the only way to go since : - it's native code in the end - SetMinThreads(wt,ct); doesn't seem to help much Rotor's source code (sscli/clr/src/vm/win32threadpool.cpp) seems in debug mode to lookup the CLR config file for a "MaxThreadpoolThreads" keyword in it, and replaces the default "25 * nbCPUs" value with it, if any. I don't know at this point if the commercial CLR does it too.