public TestShortTerm() { StartInfo info = new StartInfo { Timeout = 1, MinWorkerThreads = 1 }; _pool = ThreadPoolFactory.Create(info, "short term pool"); }
public TestLongTerm() { StartInfo info = new StartInfo { Timeout = 5, MinWorkerThreads = 1, MaxWorkerThreads = 5, }; _pool = ThreadPoolFactory.Create(info, "long term pool"); }
public TestQueueStrategy() { _info = new StartInfo { Timeout = 1, MinWorkerThreads = 1, MaxWorkerThreads = 1, MaxQueueCount = 3 }; _pool = ThreadPoolFactory.Create(_info, "pool - limited queue"); }
private static void TestMyThreadPool() { StartInfo info = new StartInfo { Timeout = 1, MinWorkerThreads = 1 }; IThreadPool pool = ThreadPoolFactory.Create(info, "long term pool"); for (int i = 0; i < 5; i++) { pool.QueueUserWorkItem(Print, "i'm item" + i, "item" + i); } pool.WaitAll(); }