private static void runSubscribe(ISubscriber[] subscribers, IPublisher publisher) { Thread t = new Thread(() => { while (true) { Thread.Sleep(1); IList<int> channels = new List<int>(); for (int i = countOfChannels - 1; i >= 0; i--) { channels.Add(rnd.Next(countOfChannels)); } publisher.subscribe(subscribers[rnd.Next(subscribers.Length)], channels); } }) {IsBackground = true, Priority = ThreadPriority.Lowest}; t.Start(); }