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





  • Posts   Search Threads
  • mklvmlDecember 6, 2011 11:52 AM PST   
    warning: leaked X task objects

    This warning seems undocumented. Could you explain its meaning?

    Raf SchietekatDecember 6, 2011 6:20 PM PST
    Rate
     
    warning: leaked X task objects

    If you ask a question here, please make an effort and provide details even if you don't see whether they might be relevant.


    Sergey KostrovDecember 6, 2011 8:22 PM PST
    Rate
     
    Warning: Leaked X task objects - some technical details

    >>...This warning seems undocumented. Could you explain its meaning?

    There is a __TBB_COUNT_TASK_NODES macro. When the __TBB_COUNT_TASK_NODES macro is
    defined a verification will be done to detect "Task Leaks".

    In another words, it warns that some resources allocated for tasks are not released due to some reason.
    A member my_task_node_count should be equal to zero if everithing was fine. If it is not zero a
    'runtime_warning( ... )' method will be called and the warning message is displayed.

    Here is some summary from the TBB's sources:

    market.h
       ...
            #if __TBB_COUNT_TASK_NODES
            //! Net number of nodes that have been allocated from heap.
            /** Updated each time a scheduler or arena is destroyed. */
            atomic<intptr_t> my_task_node_count;
            #endif /* __TBB_COUNT_TASK_NODES */
       ...
            #if __TBB_COUNT_TASK_NODES
            ...
            //! Net number of nodes that have been allocated from heap.
            /** Updated each time a scheduler or arena is destroyed. */
            void update_task_node_count( intptr_t delta )
            {
                 my_task_node_count += delta;
            }
            #endif /* __TBB_COUNT_TASK_NODES */
       ...

    market.cpp
       ...
       void market::destroy()
       {
            #if __TBB_COUNT_TASK_NODES
            if ( my_task_node_count )
                 runtime_warning( "Leaked %ld task objects\n", ( long )my_task_node_count );
            #endif /* __TBB_COUNT_TASK_NODES */
            this->~market();
            NFS_Free( this );
            __TBB_InitOnce::remove_ref();
       }
       ...

    scheduler.cpp
       ...
       void generic_scheduler::free_scheduler()
       {
            ...
            #if __TBB_COUNT_TASK_NODES
            my_market->update_task_node_count( my_task_node_count );
            #endif /* __TBB_COUNT_TASK_NODES */
            ...
       }
       ...

    arena.cpp
       ...
       void arena::free_arena()
       {
            ...
            #if __TBB_COUNT_TASK_NODES
            my_market->update_task_node_count( -drained );
            #endif /* __TBB_COUNT_TASK_NODES */
            ...
       }
    ...

    There is also a Test-Case at:

       <TBB>\Src\Test\test_task_leaks.cpp



Forum jump:  

Intel Software Network Forums Statistics

17,025 users have contributed to 48,321 threads and 172,753 posts to date.

In the past 24 hours, we have 16 new thread(s) 57 new posts(s), and 54 new user(s).

In the past 3 days, the most popular thread for everyone has been How to manage rounding by IVF ?? The most posts were made to Most likely, the issue is that The post with the most views is Optimalization of sine function\'s taylor expansion

Please welcome our newest member redfruit83


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