Manages parallel for loops. Cannot handle general task-based parallelism.
Inheritance: IDisposable
Exemplo n.º 1
0
        internal ParallelLoopWorker(ParallelLoopManager manager, Action<object> threadStart, object initializationInformation)
        {
            this.manager = manager;
            this.threadStart = threadStart;
            this.initializationInformation = initializationInformation;

            getToWork = new AutoResetEvent(false);

            thread = new Thread(Work) {IsBackground = true};
            thread.Start();
        }
Exemplo n.º 2
0
        internal ParallelLoopWorker(ParallelLoopManager manager, Action <object> threadStart, object initializationInformation)
        {
            this.manager     = manager;
            this.threadStart = threadStart;
            this.initializationInformation = initializationInformation;

            getToWork = new AutoResetEvent(false);

            thread = new Thread(Work);
            thread.IsBackground = true;
            thread.Start();
        }
Exemplo n.º 3
0
        internal ParallelLoopWorker(ParallelLoopManager manager, Action <object> threadStart, object initializationInformation)
        {
            this.manager     = manager;
            this.threadStart = threadStart;
            this.initializationInformation = initializationInformation;

            getToWork = new AutoResetEvent(false);

#if WINRT
            Windows.System.Threading.ThreadPool.RunAsync(op => Work(),
                                                         Windows.System.Threading.WorkItemPriority.Normal,
                                                         Windows.System.Threading.WorkItemOptions.TimeSliced);
#else
            var thread = new Thread(Work)
            {
                IsBackground = true
            };
            thread.Start();
#endif
        }
Exemplo n.º 4
0
 /// <summary>
 /// Constructs a new specialized thread manager
 /// that manages loops and tasks separately.
 /// </summary>
 public SpecializedThreadManager()
 {
     taskManager = new ThreadTaskManager();
     loopManager = new ParallelLoopManager();
 }
Exemplo n.º 5
0
 /// <summary>
 /// Constructs a new specialized thread manager
 /// that manages loops and tasks separately.
 /// </summary>
 public SpecializedThreadManager()
 {
     taskManager = new ThreadTaskManager();
     loopManager = new ParallelLoopManager();
 }