You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Excuse me, sir.
I want to add 2 new functions named PreRun and PostRun, where I want to do some preparation before running with multi-thread. I finished them in function:
void TaskScheduler::WaitforTask( const ICompletable* pCompletable_, enki::TaskPriority priorityOfLowestToRun_ )
, and added these codes at the begin:
auto* nonConstICompletablePtr = const_cast<ICompletable*>(pCompletable_);
if (nonConstICompletablePtr) nonConstICompletablePtr->PreRunExecuteRange();
added these codes at the end:
if (nonConstICompletablePtr) nonConstICompletablePtr->PostRunExecuteRange();
It works well on Linux, but reports error on Windows, I don't know what caused it.
Could you please give me some advice about where I should add these 2 functions properly?
THANKS!
The text was updated successfully, but these errors were encountered:
Altering enkiTS internals is non-trivial, and I wouldn't recommend doing so.
I also don't quite understand what you want to do. The function WaitforTask is not doing any multi-threaded work, it is simply running available tasks on it's own thread whilst waiting (rather than doing nothing).
If you want to run code before and after the ExecuteRange function then the best approach would be to either create a task dependency chain (see the example Dependencies.cpp), or add a new base task function as follows:
If this isn't what you are trying to achieve let me know.
You may also want to look at the ProfilerCallbacks in case what you want is to call functions when certain events occur. See the eniTSExamples for examples on how to use these.
Excuse me, sir.
I want to add 2 new functions named PreRun and PostRun, where I want to do some preparation before running with multi-thread. I finished them in function:
void TaskScheduler::WaitforTask( const ICompletable* pCompletable_, enki::TaskPriority priorityOfLowestToRun_ )
, and added these codes at the begin:
auto* nonConstICompletablePtr = const_cast<ICompletable*>(pCompletable_);
if (nonConstICompletablePtr) nonConstICompletablePtr->PreRunExecuteRange();
added these codes at the end:
if (nonConstICompletablePtr) nonConstICompletablePtr->PostRunExecuteRange();
It works well on Linux, but reports error on Windows, I don't know what caused it.
Could you please give me some advice about where I should add these 2 functions properly?
THANKS!
The text was updated successfully, but these errors were encountered: