- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I can't reproduce this behavior in a small test application.
I try to reinitialize the globaltask_scheduler_init variable to use another number of working threads in my large MFC-based application. I do it this way:
[bash]stop_my_calc();//completely stop all calculation tsi.terminate();//tsi is the global task_scheduler_init variable tsi.initialize(new_number_of_threads); restart_my_calc();//restart calculation[/bash]However the application keep using the previous number of working threads according to the Task Manager.
I can't reproduce this behavior in a small test application.
What can cause it? What is worth to check?
Best regards,
Ivan.
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Which version of TBB do you use?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tried both 2.2 and 3.0.Couldn'tcompile them unfortunately.
The problem is related somehow to the fact that during "stopping" process not all resources are being freed correctly.
The problem is related somehow to the fact that during "stopping" process not all resources are being freed correctly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
A possible reason could be that when you initialize/terminate scheduler, another instance already exists. E.g. this may happen because of auto-initialization that takes place when you work with tasks, task group contexts, or parallel algorithms without scheduler explicitly initialized via task_scheduler_init object.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The problem is solved.
There is a non-TBB working thread in that code that uses (but doesn't host) TBB ones. At the stop step it used to be just killed. Fixed it to allow it to get terminated correctly.
There is a non-TBB working thread in that code that uses (but doesn't host) TBB ones. At the stop step it used to be just killed. Fixed it to allow it to get terminated correctly.

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