HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PDG_Scheduler.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * COMMENTS:
7  */
8 
9 #ifndef __PDG_SCHEDULER_H__
10 #define __PDG_SCHEDULER_H__
11 
12 #include "PDG_API.h"
13 
14 #include "PDG_BatchWorkItem.h"
15 #include "PDG_CookOptions.h"
16 #include "PDG_EventEmitter.h"
17 #include "PDG_File.h"
18 #include "PDG_FileUtils.h"
19 #include "PDG_NodeInterface.h"
20 #include "PDG_Types.h"
21 #include "PDG_WorkItemSort.h"
22 
23 #include <PDGT/PDGT_ValueArgs.h>
24 
27 #include <UT/UT_ConcurrentQueue.h>
28 #include <UT/UT_ConcurrentSet.h>
29 #include <UT/UT_StringArray.h>
30 #include <UT/UT_StringHolder.h>
31 #include <UT/UT_TBBSpinLock.h>
32 
33 #include <time.h>
34 
35 class PDG_CookState;
36 class PDG_GraphContext;
37 class PDG_Node;
38 class PDG_Service;
39 class PDG_WorkItem;
40 
41 namespace PDGN
42 {
43 class PDGN_PollingClientNNG;
44 }
45 
46 /*
47  * Base class for scheduler nodes, which process work items and run them
48  * either in process or out of process
49  */
51  public PDG_EventEmitter,
52  public PDG_TypeInstance,
54 {
55 public:
56  /*
57  * Enumeration of possible return values from onScheduler callback
58  */
60  {
61  /// The work item was cooked, and should be marked as canceled
63 
64  /// The work item was cooked, and should be marked as failed
66 
67  /// The work item was cooked, and should be marked as succeeded
69 
70  /// The call to schedule the work item failed
72 
73  /// The call to schedule the work item succeeded
75 
76  /// The scheduler cannot handle the work item at this time
78 
79  /// The scheduler cannot handle any work items at this time, and
80  /// all further scheduling requests will be deferred
81  eFullDeferred
82  };
83 
84  /*
85  * Enumeration of possible return values from onTick callback
86  */
88  {
89  /// The scheduler is ready to accept work items
91 
92  /// The scheduler is busy, and cannot process additional work items
94 
95  /// The scheduler has encountered some sort of fatal error or request
96  /// to cancel, and will not longer accept work items for the remainder
97  /// of the cook.
98  eSchedulerCancelCook
99  };
100 
101  /*
102  * Enumeration of possible return values from onAcceptWorkItem callback
103  */
105  {
106  /// The scheduler is able to handle the specified work item
108 
109  /// The scheduler is not able to handle the specified work item
111 
112  /// The scheduler cannot tell if can/can't schedule the specified
113  /// work item, and the default logic for checking should be used
114  /// instead
115  eSchedulerDefault
116  };
117 
118  /*
119  * Enumeration of path mapping modes available on the scheduler
120  */
122  {
123  /// Use the default, global path mapping
125 
126  /// Disable path mapping
127  eNoPathMapping
128  };
129 
130  /*
131  * Enumeration of work item data transfer modes
132  */
134  {
135  /// Work item data is transfered to the farm using a shared
136  /// drive, by writing it to .json file on disk.
138 
139  /// Work item data is transfered via RPC
140  eSourceRPCMessage
141  };
142 
143  /*
144  * Enumeration of temp dir cleanup options
145  */
147  {
148  /// The temp file dir is not cleaned up automatically
150 
151  /// The temp file dir is cleaned up when the scheduler is removed or
152  /// the session shuts down
154 
155  /// The temp file dir is cleaned up after the scheduler finishes
156  /// cooking
157  eCleanupCook
158  };
159 
160 public:
162  const PDGT_ValueArgs& extra_args,
163  const UT_StringHolder& name);
164  ~PDG_Scheduler() override;
165 
166  /// Returns the list of supported event types
168  supportedEventTypes() const override;
169 
170  int64 getMemoryUsage(bool inclusive) const override;
171 
172  /// Debug name method, required by PDGE_DependencyOwner
173  UT_StringHolder debugName() const override
174  { return name(); }
175 
176  /// Resets the dependency owner
177  void resetOwner() override;
178 
179  /// Returns the is cooked dep for this scheduler
181  { return &myIsCookedDep; }
182 
183  /// Returns the name of the shceudler
184  const UT_StringHolder& name() const
185  { return myName; }
186 
187  /// Called when the type object should reload itself because of a change
188  /// to the underlying Python module
189  bool reloadInstance(UT_WorkBuffer& errors) override;
190 
191  /// Returns true if the scheduler is able to queue the specified work item,
192  /// else false.
193  bool canSchedule(const PDG_WorkItem* work_item);
194 
195  /// Called when the scheduler should process a static dependency graph
196  virtual void onScheduleStatic(
197  const PDG_WorkItemMap& dependencies,
198  const PDG_WorkItemMap& dependents,
199  const PDG_WorkItemArray& ready_items) = 0;
200 
201  /// Called whenever the scheduler should schedule a work item. This is a
202  /// required callback.
203  virtual ScheduleResult onSchedule(PDG_WorkItem* work_item) = 0;
204 
205  /// Called when a specific work item should be canceled
206  virtual void onCancelWorkItems(
207  const PDG_WorkItemArray& work_item,
208  PDG_Node* node) = 0;
209 
210  /// Called when the scheduler is first started, should be used to initialize
211  /// scheduler state, threads, etc. This is an optional callback.
212  virtual bool onStart() = 0;
213 
214  /// Called when the scheduler is stopped, to clean up any resources held
215  /// by the scheduler (sockets, threads, etc). Optional callback.
216  virtual bool onStop() = 0;
217 
218  /// Called when cooking begins
219  virtual bool onStartCook(
220  bool static_cook,
221  const PDG_NodeSet&) = 0;
222 
223  /// Called when cooking completes or is canceled
224  virtual bool onStopCook(bool cancel) = 0;
225 
226  /// Called once at the start of the cook, to allow the scheduler to
227  /// set any custom cook options
228  virtual void onConfigureCook(PDG_CookOptions* cook_ptions) = 0;
229 
230  /// Called periodically during cooking to update state
231  virtual TickResult onTick() = 0;
232 
233  /// Returns an enum indicating whether or not the scheduler accepts the
234  /// specified work item
235  virtual AcceptResult onAcceptWorkItem(
236  const PDG_WorkItem* work_item) = 0;
237 
238  /// Custom file transfer logic, implemented per-scheduler
239  virtual bool onTransferFile(const UT_StringHolder& file_path);
240 
241  /// Transfers a file from the local machine to the machine that will be
242  /// executing processor tasks, e.g. a remote machine on the farm. This
243  /// callback is required since the main PDG code depends on its existence.
244  /// At a later point we may be able to make this optional.
245  bool transferFile(
246  const UT_StringHolder& file_path,
247  PDG_FileUtils::TransferType default_type,
248  UT_WorkBuffer& errors) const;
249 
250  /// Returns the path on the scheduler that a local file will be copied
251  /// to, using the standard file transfer mechanism
252  UT_StringHolder formatTransferPath(
253  const UT_StringHolder& local_path,
254  PDG_FileUtils::TransferType default_type,
255  bool local) const;
256 
257  /// Returns the local version of the given path.
258  UT_StringHolder localizePath(
259  const UT_StringHolder& deloc_path) const;
260 
261  /// Returns the delocalized (remote) version of the given local path.
262  UT_StringHolder delocalizePath(
263  const UT_StringHolder& local_path) const;
264 
265  /// Returns the job name for the specified work item
266  UT_StringHolder jobName(const PDG_WorkItem* work_item) const;
267 
268  /// Expands special tokens in the command string
269  virtual UT_StringHolder expandCommandTokens(
270  const UT_StringHolder& command,
271  const PDG_WorkItem* work_item) = 0;
272 
273  /// cook the output node in the graph context of the given file as a single job
274  virtual UT_StringHolder submitAsJob(
275  const UT_StringHolder& graph_file,
276  const UT_StringHolder& node_name) = 0;
277 
278  /// set the working directory local and network path, equivalent
279  /// to the __PDG_DIR__
280  void setWorkingDir(const UT_StringHolder& local_path,
281  const UT_StringHolder& remote_path);
282  /// set the temp directory local and network path, equivalent
283  /// to the __PDG_TEMP__
284  void setTempDir(const UT_StringHolder& local_path,
285  const UT_StringHolder& remote_path);
286  /// set the script directory local and network path, equivalent
287  /// to the __PDG_SCRIPTDIR__
288  void setScriptDir(const UT_StringHolder& local_path,
289  const UT_StringHolder& remote_path);
290 
291  /// sets whether or not the scheduler accepts in-process work items
292  void setAcceptInProcess(bool in_process);
293 
294  /// returns the working directory (network) path, equivalent
295  /// to the __PDG_DIR__ command token when local is false.
296  /// When local is true, returns the absolute path to the shared root
297  /// on the local file system
298  UT_StringHolder workingDir(bool local) const;
299 
300  /// returns the temp directory (network) path, equivalent
301  /// to the __PDG_TEMP__ command token when local is false.
302  /// When local is true, returns the absolute path to the shared temp
303  /// on the local file system
304  UT_StringHolder tempDir(bool local) const;
305 
306  /// returns the temp script directory (network) path, equivalent
307  /// to the __PDG_SCRIPTDIR__ command token when local is false.
308  /// When local is true, returns the absolute path to the temp
309  /// script on the local file system
310  UT_StringHolder scriptDir(bool local) const;
311 
312  /// Returns the path to the directory where log files generated during the
313  /// cook should be written.
314  /// When local is true, returns the aboslute path on the local file system.
315  UT_StringHolder logDir(bool local) const;
316 
317  /// Returns the path to the directory where work items are serialized
318  /// before their commands are executed.
319  /// When local is true, returns the aboslute path on the local file system.
320  UT_StringHolder dataDir(bool local) const;
321 
322  /// Returns the path to an application for the given name, for example
323  /// "python", "hython"
324  virtual UT_StringHolder applicationBin(const UT_StringHolder& name,
325  const PDG_WorkItem* work_item);
326 
327  /// returns the server endpoint for work item results, in format <HOST>:<PORT>,
328  /// equivalent to the __PDG_RESULT_SERVER__ command token
329  virtual UT_StringHolder workItemResultServerAddr() = 0;
330 
331  /// returns a URI for the workitem cook log (text file)
332  virtual UT_StringHolder getLogURI(const PDG_WorkItem* work_item) = 0;
333  /// returns a URI for the workitem status page if relevant
334  virtual UT_StringHolder getStatusURI(const PDG_WorkItem* work_item) = 0;
335 
336  /// Terminate the give shared server
337  virtual bool endSharedServer(
338  const UT_StringHolder& sharedserver_name) = 0;
339  /// Clears metadata associated with the given shared server name
340  virtual void clearSharedServerInfo(
341  const UT_StringHolder &sharedserver_name);
342  /// Sets metadata associated with the given shared server name, returns full name
343  virtual UT_StringHolder setSharedServerInfo(
344  const UT_StringHolder &sharedserver_name,
345  const PDGT_ValueArgs& info);
346  /// Gets metadata associated with the given shared server name
347  PDGT_ValueArgs getSharedServerInfo(
348  const UT_StringHolder &sharedserver_name);
349  /// Gets the list of shared servers
350  UT_StringArray getSharedServers();
351 
352  /// Delete the temporary directory and all its contents
353  virtual void cleanTempDirectory();
354 
355  /// Called to stop the running cook
356  void stop(bool exiting);
357  bool startCook(PDG_CookState& cook_state);
358  void stopCook();
359  void cancelCook(bool pause);
360  bool tick(PDG_Scheduler::TickResult& tick_result);
361  bool cookWorkItem(PDG_WorkItem* work_item);
362 
363  void submitStatic();
364  virtual PDG_WorkItemState
365  queueWorkItem(PDG_WorkItem* work_item);
366  void removeWorkItem(const PDG_WorkItem* work_item);
367 
368  void cancelWorkItem(PDG_WorkItem* work_item);
369  void cancelNode(PDG_Node* node);
370 
371  void onWorkItemPriorityChanged(PDG_WorkItem* work_item);
372  void process(bool skip_ready_items);
373 
374  bool isRunning(int count=0);
375  bool isRunning(const PDG_WorkItem* work_item);
376  bool isDefault();
377 
378  bool isWaitForFailures() const;
379  bool isValidateOutputFiles() const;
380  bool isCheckExpectedOutputFiles() const;
381  bool isCompressWorkItemData() const;
382  virtual PDGN::PDGN_PollingClientNNG*
383  getPollingClient() { return nullptr; }
384 
385  WorkItemDataSource workItemDataSource() const;
386 
387  int numRunningItems() const;
388  int numFailedItems() const;
389  int numQueuedItems() const;
390 
391  void setContext(PDG_GraphContext* context);
392  PDG_GraphContext* context() const;
393 
394  void dependencyGraph(
395  PDG_WorkItemMap& dependencies,
396  PDG_WorkItemMap& dependents,
397  PDG_WorkItemArray& ready,
398  bool expand);
399 
400  /// Starts a service using this scheduler
401  virtual bool startService(UT_WorkBuffer& errors,
402  PDG_Service* service)
403  {
404  return false;
405  }
406 
407  /// Stops a service that was started with this scheduler
408  virtual bool stopService(UT_WorkBuffer& errors,
409  PDG_Service* service)
410  {
411  return false;
412  }
413 
414  template <typename T, typename D=T>
416  PDG_NodeInterface* node,
417  const UT_StringHolder& prefix,
418  const UT_StringHolder& parm,
419  PDG_WorkItem* work_item,
420  const D& default_value,
421  UT_WorkBuffer& errors) const
422  {
423  UT_WorkBuffer parm_name;
424  UT_WorkBuffer toggle_name;
425 
426  if (prefix.isstring() && prefix.length() > 0)
427  {
428  toggle_name.format("{}_override_toggle", templateName());
429  parm_name.format("{}_{}", prefix, parm);
430  }
431  else
432  {
433  parm_name.append(parm);
434  }
435 
436  // If the user supplied us with a batch item, evaluate against the first
437  // sub item instead
438  PDG_WorkItem* eval_work_item = work_item;
439  if (work_item && work_item->isBatch())
440  {
441  auto batch_item =
442  static_cast<PDG_BatchWorkItem*>(work_item);
443  if (batch_item->batchSize() > 0)
444  eval_work_item = batch_item->batchItems()[0];
445  }
446 
447  result = default_value;
448  PDG_Port* port = parameter(parm_name.buffer());
449  if (port)
450  {
451  if (!port->evaluate(0, result, eval_work_item, errors))
452  return false;
453  }
454 
455  if (!node)
456  return true;
457 
458  port = node->parameter(toggle_name.buffer());
459 
460  if (port)
461  {
462  exint toggle_result;
463  port->evaluate(0, toggle_result, eval_work_item, errors);
464 
465  if (toggle_result < 1)
466  return true;
467  }
468 
469  port = node->parameter(parm_name.buffer());
470  if (port)
471  {
472  if (!port->evaluate(0, result, eval_work_item, errors))
473  return false;
474  }
475 
476  return true;
477  }
478 
479 
480  void onWorkItemSetStringArray(
481  PDG_WorkItemID work_item_id,
482  int index,
483  const UT_StringHolder& attribute_name,
485  void onWorkItemSetFloatArray(
486  PDG_WorkItemID work_item_id,
487  int index,
488  const UT_StringHolder& attribute_name,
490  void onWorkItemSetIntArray(
491  PDG_WorkItemID work_item_id,
492  int index,
493  const UT_StringHolder& attribute_name,
495  void onWorkItemSetFileArray(
496  PDG_WorkItemID work_item_id,
497  int index,
498  const UT_StringHolder& attribute_name,
500 
501  void onWorkItemSetPyObject(
502  PDG_WorkItemID work_item_id,
503  int index,
504  const UT_StringHolder& attribute_name,
505  const UT_StringHolder& pyobject_repr);
506  void onWorkItemSetString(
507  PDG_WorkItemID work_item_id,
508  int index,
509  const UT_StringHolder& attribute_name,
510  const UT_StringHolder& value,
511  int attrib_index);
512  void onWorkItemSetFloat(
513  PDG_WorkItemID work_item_id,
514  int index,
515  const UT_StringHolder& attribute_name,
516  fpreal value,
517  int attrib_index);
518  void onWorkItemSetInt(
519  PDG_WorkItemID work_item_id,
520  int index,
521  const UT_StringHolder& attribute_name,
522  exint value,
523  int attrib_index);
524  void onWorkItemSetFile(
525  PDG_WorkItemID work_item_id,
526  int index,
527  const UT_StringHolder& attribute_name,
529  int attrib_index);
530 
531  void onWorkItemAddOutput(
532  PDG_WorkItemID work_item_id,
533  int index,
534  const UT_StringHolder& path,
535  const UT_StringHolder& tag,
536  PDG_File::Hash hash_code,
537  bool active_only);
538  void onWorkItemAddOutputs(
539  PDG_WorkItemID work_item_id,
540  int index,
541  const UT_StringArray& paths,
542  const UT_StringHolder& tags,
543  const PDG_File::HashArray& hashes,
544  bool active_only);
545  void onWorkItemAddOutputs(
546  PDG_WorkItemID work_item_id,
547  int index,
548  const UT_StringArray& paths,
549  const UT_StringArray& tags,
550  const PDG_File::HashArray& hashes,
551  bool active_only);
552  void onWorkItemInvalidateCache(
553  PDG_WorkItemID work_item_id,
554  int index);
555 
556  void onWorkItemSucceeded(
557  PDG_WorkItemID work_item_id,
558  int index,
559  fpreal cook_duration);
560  void onWorkItemFailed(
561  PDG_WorkItemID work_item_id,
562  int index);
563  void onWorkItemCanceled(
564  PDG_WorkItemID work_item_id,
565  int index);
566  void onWorkItemStartCook(
567  PDG_WorkItemID work_item_id,
568  int index,
569  bool clear_outputs);
570 
571  void onWorkItemSetCustomState(
572  PDG_WorkItemID work_item_id,
573  int index,
574  const UT_StringHolder& custom_state);
575  void onWorkItemSetCookPercent(
576  PDG_WorkItemID work_item_id,
577  int index,
578  fpreal &cook_percent);
579  void onWorkItemAppendLog(
580  PDG_WorkItemID work_item_id,
581  int index,
582  const UT_StringHolder& log_data,
583  PDG_WorkItemLogType log_type);
584 
585  PDG_WorkItemEvalState isWorkItemReady(
586  PDG_WorkItemID work_item_id,
587  int index);
588 
589  /// Emits errors or warnings from the scheduler as PDG_Events
590  void addError(
591  const UT_StringHolder& message) const override;
592  void addWarning(
593  const UT_StringHolder& message) const override;
594 
595  virtual fpreal tickPeriod() const;
596  virtual int maxItemsPerTick() const;
597  virtual int maxConcurrentTasks() const;
598 
599  PathMappingMode mapMode() const;
600 
601 protected:
602  /// Find the workitem and report error if not found
603  PDG_WorkItem* workItemChecked(
604  PDG_WorkItemID work_item_id,
605  int index);
606 
608  PDGE_Resolutions& resolutions,
609  const PDGE_Evaluator& evaluator,
610  PDGE_Dependency* dependency) override;
611 
612 private:
613  struct Result
614  {
615  PDG_WorkItemState myState;
616  PDG_WorkItemID myId;
617  fpreal myDuration;
618  int myIndex;
619  bool myUnresolve;
620  };
621 
622  using ResultMap = UT_Map<PDG_WorkItemID, Result>;
623  using ResultQueue = UT_ConcurrentQueue<Result>;
624 
625  using PriorityQueue =
628  using WorkItemSet = UT_ConcurrentSet<PDG_WorkItemID>;
629  using NodeSet = UT_ConcurrentSet<PDG_Node*>;
630  using SharedServerInfoMap =
631  UT_ConcurrentHashMap<UT_StringHolder, PDGT_ValueArgs>;
632 
633 private:
634  ScheduleResult schedule(PDG_WorkItem* work_item,
635  UT_Array<Result>& pending);
636  int markCompleted(const Result& result,
637  UT_Array<Result>& pending);
638  PDG_WorkItem* workItem(
639  PDG_WorkItemID work_item_id,
640  int index);
641  void updateDefaultDirectories();
642 
643 private:
644  PDGE_Dependency myIsCookedDep;
645 
646  PriorityQueue myScheduleQueue;
647  ResultQueue myScheduleResults;
648  ResultMap myPauseResults;
649  SharedServerInfoMap mySharedServerInfo;
650  PDG_WorkItemIDSet myPausedItems;
651 
652  WorkItemSet myRunningItems;
653  WorkItemSet myFailedItems;
654  WorkItemSet myLongRunningItems;
655 
656  WorkItemSet myCanceledItems;
657  NodeSet myCanceledNodes;
658 
659  UT_StringHolder myName;
660  UT_StringHolder myLocalWorkingDir;
661  UT_StringHolder myLocalTempDir;
662  UT_StringHolder myLocalScriptDir;
663  UT_StringHolder myRemoteWorkingDir;
664  UT_StringHolder myRemoteTempDir;
665  UT_StringHolder myRemoteScriptDir;
666 
667  PDG_GraphContext* myContext;
668 
669  time_t myLastTick;
670  WorkItemDataSource myDataSource;
671  TempDirCleanup myTempDirCleanup;
672 
673  UT_TBBSpinLock myProcessLock;
674 
675  bool myCancelingFlag;
676  bool myPausingFlag;
677  bool myStaticCook;
678  bool myInProcess;
679 
680  bool myIsWaitForFailures;
681  bool myIsValidateOutputFiles;
682  bool myIsCheckExpectedOutputFiles;
683  bool myIsCompressWorkItemData;
684 };
685 
686 #endif /* __PDG_SCHEDULER_H__ */
The work item was cooked, and should be marked as succeeded.
Definition: PDG_Scheduler.h:68
GLuint GLsizei const GLchar * message
Definition: glcorearb.h:2543
const UT_StringHolder & name() const
Returns the name of the shceudler.
virtual bool startService(UT_WorkBuffer &errors, PDG_Service *service)
Starts a service using this scheduler.
The scheduler is able to handle the specified work item.
Use the default, global path mapping.
Comparator< PriorityComparator, Reverse > Priority
Functor that compares two work item references or pointers by priority.
#define PDG_API
Definition: PDG_API.h:23
GLsizei const GLchar *const * path
Definition: glcorearb.h:3341
The scheduler is not able to handle the specified work item.
int64 exint
Definition: SYS_Types.h:125
SYS_FORCE_INLINE const char * buffer() const
The call to schedule the work item succeeded.
Definition: PDG_Scheduler.h:74
The temp file dir is not cleaned up automatically.
The work item was cooked, and should be marked as failed.
Definition: PDG_Scheduler.h:65
**But if you need a result
Definition: thread.h:613
bool evaluateOverride(T &result, PDG_NodeInterface *node, const UT_StringHolder &prefix, const UT_StringHolder &parm, PDG_WorkItem *work_item, const D &default_value, UT_WorkBuffer &errors) const
virtual void addWarning(const UT_StringHolder &message) const
Adds a warning to the node interface – implemented in subclasses.
virtual bool reloadInstance(UT_WorkBuffer &errors)
The call to schedule the work item failed.
Definition: PDG_Scheduler.h:71
virtual PDGN::PDGN_PollingClientNNG * getPollingClient()
int64 Hash
The file hash/modtime type.
Definition: PDG_File.h:38
exint length() const
The work item was cooked, and should be marked as canceled.
Definition: PDG_Scheduler.h:62
bool isBatch() const
Returns true if the work tiem is a batch.
PDG_WorkItemLogType
Enumeration of work item log message types.
Definition: PDG_Types.h:377
const UT_StringHolder & templateName() const
virtual void addError(const UT_StringHolder &message) const
Adds an error to the node interface – implemented in subclasses.
long long int64
Definition: SYS_Types.h:116
virtual int64 getMemoryUsage(bool inclusive) const
Returns the memory usage of this owner instance.
GLuint const GLchar * name
Definition: glcorearb.h:786
virtual Filter & supportedEventTypes() const =0
Returns the list of supported event types for this emitter.
PDG_WorkItemState
Enum of possible work item states.
Definition: PDG_Types.h:413
PDG_WorkItemEvalState
Definition: PDG_Types.h:364
size_t format(const char *fmt, const Args &...args)
TransferType
Enumeration of file transfer destination paths.
Definition: PDG_FileUtils.h:83
PDG_Port * parameter(const UT_StringHolder &name, int multi=-1) const
virtual bool stopService(UT_WorkBuffer &errors, PDG_Service *service)
Stops a service that was started with this scheduler.
fpreal64 fpreal
Definition: SYS_Types.h:277
The scheduler cannot handle the work item at this time.
Definition: PDG_Scheduler.h:77
GLuint index
Definition: glcorearb.h:786
The scheduler is busy, and cannot process additional work items.
Definition: PDG_Scheduler.h:93
SYS_FORCE_INLINE void append(char character)
UT_StringHolder debugName() const override
Debug name method, required by PDGE_DependencyOwner.
The scheduler is ready to accept work items.
Definition: PDG_Scheduler.h:90
virtual PDGE_Dependency::State evalResolve(PDGE_Resolutions &, const PDGE_Evaluator &, PDGE_Dependency *)
Called when a dependency owned by this object is resolved.
void pause(int delay) noexcept
Definition: thread.h:102
Definition: core.h:1131
#define UT_ConcurrentPriorityQueue
exint PDG_WorkItemID
Type defs for unique work item IDs.
Definition: PDG_Types.h:48
bool evaluate(int index, fpreal &result, const PDG_WorkItem *work_item, UT_WorkBuffer &errors) const
PDGE_Dependency * isCookedDep()
Returns the is cooked dep for this scheduler.
type
Definition: core.h:1059
virtual void resetOwner()
Resets the owner.
GLint GLsizei count
Definition: glcorearb.h:405
SYS_FORCE_INLINE bool isstring() const