VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
vtkExecutionScheduler.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkExecutionScheduler.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
15 /*-------------------------------------------------------------------------
16  Copyright (c) 2008, 2009 by SCI Institute, University of Utah.
17 
18  This is part of the Parallel Dataflow System originally developed by
19  Huy T. Vo and Claudio T. Silva. For more information, see:
20 
21  "Parallel Dataflow Scheme for Streaming (Un)Structured Data" by Huy
22  T. Vo, Daniel K. Osmari, Brian Summa, Joao L.D. Comba, Valerio
23  Pascucci and Claudio T. Silva, SCI Institute, University of Utah,
24  Technical Report #UUSCI-2009-004, 2009.
25 
26  "Multi-Threaded Streaming Pipeline For VTK" by Huy T. Vo and Claudio
27  T. Silva, SCI Institute, University of Utah, Technical Report
28  #UUSCI-2009-005, 2009.
29 -------------------------------------------------------------------------*/
44 #ifndef __vtkExecutionScheduler_h
45 #define __vtkExecutionScheduler_h
46 
47 #include "vtkCommonExecutionModelModule.h" // For export macro
48 #include "vtkObject.h"
49 #include "vtkExecutionSchedulerManager.h" // For singleton instantiation/cleanup
50 
51 class vtkExecutive;
53 class vtkMultiThreader;
54 class vtkMutexLock;
55 class vtkThreadMessager;
56 class vtkInformation;
57 class vtkInformationIntegerKey;
59 
60 class VTKCOMMONEXECUTIONMODEL_EXPORT vtkExecutionScheduler : public vtkObject
61 {
62 public:
63  static vtkExecutionScheduler* New();
64  vtkTypeMacro(vtkExecutionScheduler,vtkObject);
65  void PrintSelf(ostream &os, vtkIndent indent);
66 
68  static vtkExecutionScheduler *GetGlobalScheduler();
69 
71  static vtkInformationIntegerKey* TASK_PRIORITY();
72 
76  void Schedule(vtkExecutiveCollection *execs, vtkInformation *info);
77 
81  void SchedulePropagate(vtkExecutiveCollection *execs, vtkInformation *info);
82 
85  void WaitUntilDone(vtkExecutiveCollection *execs);
86 
89  void WaitUntilReleased(vtkExecutiveCollection *execs);
90 
92  void WaitUntilAllDone();
93 
97  void WaitForTaskDone(vtkExecutive *exec);
98 
101  void WaitForInputsReleased(vtkExecutive *exec);
102 
105  vtkThreadMessager* GetTaskDoneMessager(vtkExecutive *exec);
106 
109  vtkThreadMessager* GetInputsReleasedMessager(vtkExecutive *exec);
110 
113  vtkMutexLock* GetInputsReleasedLock(vtkExecutive *exec);
114 
116  void ReleaseResources(vtkExecutive *exec);
117 
119  void ReacquireResources(vtkExecutive *exec);
120 
123  void RescheduleNetwork(vtkExecutive *sink);
124 
127  void RescheduleFrom(vtkExecutive *sink, vtkComputingResources *resources);
128 
129 protected:
132 
136  vtkMutexLock *ScheduleLock;
137  vtkMultiThreader *ScheduleThreader;
139 
140 //BTX
141  class implementation;
142  implementation* const Implementation;
143  friend class implementation;
144 
147  friend void * vtkExecutionScheduler_ScheduleThread(void *data);
148 
151  friend void * vtkExecutionScheduler_ExecuteThread(void *data);
152 
153 //ETX
154 
156 
157  static void ClassInitialize();
158  static void ClassFinalize();
161 
162 private:
163  vtkExecutionScheduler(const vtkExecutionScheduler&); // Not implemented.
164  void operator=(const vtkExecutionScheduler&); // Not implemented.
165 
166 };
167 
168 #endif
Scheduling execution with thread/computing resources distributing.
Superclass for all pipeline executives in VTK.
Definition: vtkExecutive.h:48
vtkMultiThreader * ScheduleThreader
Definition of computing resource (threads/kernels)
vtkThreadMessager * ScheduleMessager
A class for performing inter-thread messaging.
maintain a list of executive objects
Manage the instantiation and deletion of the vtkExecutionScheduler singleton.
vtkThreadMessager * ResourceMessager
vtkComputingResources * Resources
implementation *const Implementation