public MandelbrotServer() { TileWidth = size; TileHeight = size; MinLevel = 0; MaxLevel = 31; ServerName = "Mandelbrot"; // todo number of processors being used is a problem - too small is slow, too big blocks all other threads, including rendering thread, so // application stops to respond. TaskManagerPolicy policy = new TaskManagerPolicy(1, Environment.ProcessorCount, 1, 0, System.Threading.ThreadPriority.Lowest); manager = new TaskManager(policy); }
internal TaskManager (TaskManagerPolicy policy, IScheduler sched) { this.policy = policy; this.sched = sched; }
public TaskManager (TaskManagerPolicy policy) : this (policy, new Scheduler (Parallel.GetBestWorkerNumber (policy), policy.MaxStackSize, policy.ThreadPriority)) { }