/// <summary> /// setup for threads /// </summary> public void GenerateThreads() { try { int i = 1; foreach (Reactor reactor in this.reactors) { switch (reactor.selectedThreadingType) { case ThreadingType.SingleThreading: reactor.ExecuteThread(); break; case ThreadingType.MultiThreading: Thread thread = new Thread(reactor.ExecuteThread) { Name = reactor.ToString() + i }; thread.Start(); break; case ThreadingType.ThreadPool: ThreadPool.QueueUserWorkItem(reactor.ThreadProcess); break; } Thread.Sleep(100); i++; } } catch (Exception e) { Debug.WriteLine("\n\n\n\nException\nmessage: {0}\nStacktrace: {1}", e.Message, e.StackTrace); } }