<summary> Spelunking Microsoft Technologies - Win32, .NET and Rotor </summary>
using WinToolZone;

Skip Navigation Links
Home
Latest
.NET
Rotor
Windows
[Web] Services
Publications
PresentationsExpand Presentations
Spoken At...
My...Expand My...
GuestbookExpand Guestbook
Feedback

You are visitor  counter

















  • 4th September 2005

    Enhanced the System.Diagnostics.Process class to support process enumeration via the GetProcesses method for Rotor v1.0. The support has been added for the Win32 PAL for the moment and the following snippet exemplifies how it can be used:

    using

    System;
    using System.Diagnostics;

    public class
    EnumProcess
    {

    public static void Main()
    {

    Process[] arrProcess = Process.GetProcesses();

    if (arrProcess == null)
    {

    Console.WriteLine("Unable to get process list!");
    return
    ;

    }

    Console.WriteLine("{0} processes enumerated.",arrProcess.Length);

    foreach (Process proc in
    arrProcess)
          Console.WriteLine("Process ID {0}, Handle: {1}"
    , proc.Id, proc.Handle);

    }

    }

    Download the updated Rotor source files from here. Refer to Changes for Process Enumeration.txt file for the folders where the updated files need to be deployed. Once done, rebuild Rotor to bring the changes into effect.

  • 25th July 2004 - Added support for SetMaxThreads, SetMinThreads, GetMinThreads in the Rotor ThreadPool class as they are in .NET Framework 2.0.
    Implemented and tested on Rotor v1.0

    using System;
    using System.Threading;

    public class CThreadPoolTest {

    public static void Main() {

    int iMaxThreads, iMaxIOCompletionThreads;
    Console.WriteLine("MAX THREADS TEST"); Console.WriteLine("----------------");
    ThreadPool.GetMaxThreads(out iMaxThreads, out iMaxIOCompletionThreads);
    Console.WriteLine("Max threads {0}", iMaxThreads); iMaxThreads++; // increase number of threads in the thread pool
    Console.WriteLine("Setting Status: {0}",ThreadPool.SetMaxThreads(30,0).ToString());
    ThreadPool.GetMaxThreads(out iMaxThreads, out iMaxIOCompletionThreads);
    Console.WriteLine("Max threads {0}", iMaxThreads);
    Console.WriteLine("\nMIN THREADS TEST"); Console.WriteLine("----------------\n");
    int iMinThreads = 0, iMinIOCompletionThreads = 0;
    ThreadPool.GetMinThreads(out iMinThreads, out iMinIOCompletionThreads);
    Console.WriteLine("Min Threads {0}", iMinThreads); iMinThreads = 5;
    Console.WriteLine("Setting Status: {0}",ThreadPool.SetMinThreads(iMinThreads, iMinIOCompletionThreads).ToString());
    ThreadPool.GetMinThreads(out iMinThreads, out iMinIOCompletionThreads);
    Console.WriteLine("Min Threads {0}", iMinThreads); } }

    Download the modified source code files. Refer to the contained Readme.html for instructions on how to place the files and recompile Rotor to bring the changes in effect.

  • 27th August 2003 - Added support for modifying the maximum number of threads in the Rotor thread pool using the ThreadPool class
    Implemented and tested on Rotor v1.0

    Extended the Rotor FCL (Framework Class Library) ThreadPool class to allow managed code to dynamically change the maximum number of threads the Rotor runtime maintains for its thread pool, particularly useful when you need to have a control of the thread pool size. Here's a C# snippet that exemplifies its usage:

    using System;
    using System.Threading;

    public class CThreadPoolTest
    {
     public static void Main()
     {
      int iMax1, iMax2;
      ThreadPool.GetMaxThreads(out iMax1, out iMax2);
      Console.WriteLine("Max threads {0}",iMax1);
      Console.WriteLine("{0}",ThreadPool.IncreaseMaxThreads(30).ToString());
      ThreadPool.GetMaxThreads(out iMax1, out iMax2);
      Console.WriteLine("Max threads {0}",iMax1);
     }
    }


    This snippet changes the maximum number of threads in the Rotor thread pool to 30 (instead of the default of 25 per processor).

    Download the modified source code files. Refer to the contained Readme.html for instructions on how to place the files and recompile Rotor to bring the changes in effect.