Loading...
You are not logged-in Login/Register





  • Posts   Search Threads
  • gravyjonesJuly 5, 2009 8:48 AM PDT   
    multimedia timers / task_group_context

    I have an interesting problem. 

    My application uses multimedia timers to process video from hardware devices as well as the display.

    The structure of the code to support a multimedia timer requires a static callback procedure, as a hook in point, to the system generated multimedia timer.  In my situation this is simply the static function in my class.  I make sure to initialize the timer with "this" as the user defined data.  The timer is called in the context of the multimedia timer thread, and my code will reconstruct "this" as a back pointer to the original instance of the class that caused the timer to be used.

    During the callback, when I use parallel_reduce, TBB complains about an initialization problem.  Basically, If I understand the docs correctly, this situation constitutes an isolated task, where the parent has no knowledge of TBB.  I would like to know how to use parallel_reduce in combination with an isolated task.  It seems like I have no chance of getting to initialize TBB in the multimedia timer.

    Thanks!

    The specific error is
    ---------------------------
    Microsoft Visual C++ Debug Library
    ---------------------------
    Debug Assertion Failed!

    Program: ...
    Module: tbb_debug.dll
    File: ../../src/tbb/task.cpp
    Line: 3113

    Expression: my_owner

    Thread has not activated a task_scheduler_init object?

    For information on how your program can cause an assertion
    failure, see the Visual C++ documentation on asserts.

    (Press Retry to debug the application)
    ---------------------------
    Abort Retry Ignore
    ---------------------------


    Raf SchietekatJuly 5, 2009 11:52 PM PDT
    Rate
     
    Re: multimedia timers / task_group_context

    As long as there is at least one long-lived task_scheduler_init somewhere in the process (like in main()), it is cheap enough to have another one, not necessarily unique, on the stack of any thread that may not yet be known to TBB (like a local variable in the callback).


    Alexey Kukanov (Intel)July 6, 2009 3:49 AM PDT
    Rate
     
    Re: multimedia timers / task_group_context

    Also to better support such situations, a new version of TBB (to be released later this year) will have automatic initialization of the TBB scheduler. The effect of automatic intialization will be as if a task_scheduler_init object was created inside the first call to a parallel algorithm in a thread, and was kept alive till the thread shuts down.


Forum jump:  

Intel Software Network Forums Statistics

16,376 users have contributed to 46,363 threads and 164,030 posts to date.

In the past 24 hours, we have 11 new thread(s) 28 new posts(s), and 25 new user(s).

In the past 3 days, the most popular thread for everyone has been Program compiles in release but not debug The most posts were made to You need to show us the whole The post with the most views is try_pop in concurrent_queue

Please welcome our newest member fruitbrown


For more complete information about compiler optimizations, see our Optimization Notice.