I was wondering if I can change the task scheduler that maps tasks to the real OS threads in .NET using C#, or if I need to recompile, say, the Mono runtime to do this. Thanks.
Double-click My Computer, then double-click Scheduled Tasks. Right-click the name of the scheduled task you want to modify, select Properties, and select the Task tab.
C:\Windows\System32\Tasks contains XML files that contain the definitions of scheduled tasks. The directory structure under %SYSTEMROOT%\System32\Tasks seems to correspond to the registry key structure under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tree .
Method 1: Use a System Restore Image Here are steps to fix the corrupt Task Scheduler on Windows. Step 1: Type restore in the Search menu and choose Create a restore point. Step 2: Click System Restore within the System Protection tab. Step 3: Click Next to get the list of all available restore points.
I don't know about Mono, but with the Microsoft CLR you need to basically host the CLR yourself and implement the relevant interfaces.
See this blog entry for more information.
Note that anyway that this is a very involved topic. The feature was initially only integrated in .NET 2.0 so that Microsoft SQL Server (which has a fiber-mode) could map CLR threads to fibers instead to operating system threads. AFAIK that "experiment" is considered larged failed however.
Also note that a lot of .NET (managed) code implicitly (or explicitly via P/Invoke calls to Windows API) assumes that the mapping between CLR and OS threads is actually 1:1.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With