- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Iam looking for more informationabout the initialization oftask_scheduler_init in multiple threads.
In my current programm, I use a 'TaskManager' class which calls once task_scheduler_init in the main thread.
main()
{
TaskManager *pTaskManager = new TaskManager; // Calls internally task_scheduler_init::initialize()
...
// Create a DLL
CreateDLL();
...
// Retrieve the function 'RunSystem'from the DLL via GetprocAdress("Run");
// Create a new TBB task anduse this new task to call 'Run' function
//This way 'RunSystem' runs in aDIFFERENT thread from this one.
}
I assume I passed to the function 'RunSystem' a pointer on pTaskManager like this :
TaskManager **ppPointerOnpTaskManager = &pTaskManager;
Now, in the function RunSystem, I call :
(*ppPointerOnpTaskManager)->DoSomethingUses_parallel_for();
My question is : will this force the DLL to create another task_scheduler_init, or will the one initialized IN (*pTaskManager) will be used ?
Best regards
Iam looking for more informationabout the initialization oftask_scheduler_init in multiple threads.
In my current programm, I use a 'TaskManager' class which calls once task_scheduler_init in the main thread.
main()
{
TaskManager *pTaskManager = new TaskManager; // Calls internally task_scheduler_init::initialize()
...
// Create a DLL
CreateDLL();
...
// Retrieve the function 'RunSystem'from the DLL via GetprocAdress("Run");
// Create a new TBB task anduse this new task to call 'Run' function
//This way 'RunSystem' runs in aDIFFERENT thread from this one.
}
I assume I passed to the function 'RunSystem' a pointer on pTaskManager like this :
TaskManager **ppPointerOnpTaskManager = &pTaskManager;
Now, in the function RunSystem, I call :
(*ppPointerOnpTaskManager)->DoSomethingUses_parallel_for();
My question is : will this force the DLL to create another task_scheduler_init, or will the one initialized IN (*pTaskManager) will be used ?
Best regards
Link Copied
0 Replies
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page