Threading Building Blocks Commercial Aligned Version 20_017

By Kevin Farnham (107 posts) on February 26, 2008 at 6:27 pm

A new commercial-aligned version of open source Threading Building Blocks was posted on the TBB Download tab yesterday. The new version is tbb20_017oss. I compared the tbb20_017oss source with the source code for the previous commercial aligned release (tbb20_014oss) and found not too many significant differences, if you're talking about the number of lines of code that changed. But, obviously, these changes are important enough that they warranted the creation of a new commercial aligned release.

The TBB "commercial aligned" releases, if you're unfamiliar with the term, are the most stable of all releases; these are the releases that are shipped to the customers who purchase the commercial version of TBB, which includes support from Intel.

I have been using tbb20_014oss for many months. Now that tbb20_017oss is available, I'll switch to that for most of my TBB experimentation and development.

Minor changes in tbb20_017oss

If you do a diff between the previous commercial aligned release and tbb20_017oss, you do get a lot of lines of changes. But the majority of the changes are updates: 1) to the date format in $Id: version comment statements; 2) to the copyright banner in each source file (since it's now 2008, the banners now say "Copyright 2005-2008 Intel Corporation. All Rights Reserved."). These changes are certainly not significant for developers, so we'll ignore them and move into the changes that do matter.

Visual Studio 2008 updates

There are several modifications to the index.html files for the TBB example problems, letting people know that the examples are now configured for users who work with Microsoft Visual Studio 2008, and related changes in the Makefile.windows files for the example problems.

Convex Hull changes

The convex hull example problem (which I wrote about extensively a few months ago) has some changes in declaration of the nthreads variable (it's now a size_t; previously it was declared as an int).

concurrent_hash_map

The include/tbb/concurrent_hash_map.h file has changes in the declaration of range. Here's the version 20_014 declaration:

const_range_type range( size_type grainsize ) const {

and heres the new tbb20_017oss declaration:

const_range_type range( size_type grainsize=1 ) const {

In addition, the s.allocate_array statement (line 665) was modified to extend the allocation by one:

s.allocate_array( s.my_logical_size+1 );

concurrent_queue

A change was made in include/tbb/concurrent_queue.h line 291:

 bool empty() const {return size()<=0;}

Previously, the <= was ==.

New code was added following line 220 in src/tbb/concurrent_queue.cpp, a __TBB_ASSERT in the concurrent_queue_base destructor, verifying that at most one page remains. Here's the new ~concurrent_queue_base():

concurrent_queue_base::~concurrent_queue_base() {
   size_t nq = my_rep->n_queue;
   for( size_t i=0; iarray[i].tail_page;
      __TBB_ASSERT( my_rep->array[i].head_page==tp,
            "at most one page should remain" );
      if( tp!=NULL )
         delete tp;
   }
   cache_aligned_allocator().deallocate(my_rep,1);
}

Windows machine changes

There were machine configuration thread and sleep related changes in the windows_ia32.h and windows_em64t.h files in directory include/tbb/machine.

scalable_allocator

Line 99 in scalable_allocator.h changed from:

pointer allocate( size_type n, void* hint=0 ) {

to:

pointer allocate( size_type n, void* /*hint*/ =0 ) {

task.cpp

Changes relating to allocation, alignment, and prefixes were made to task.cpp. A __TBB_ASSERT relating to task alignment was modified. Check the code to review these changes.

MemoryAllocator

Windows thread and sleep related changes were made in /src/tbbmalloc/MemoryAllocator.cpp.

Test programs

tbb20_017oss also includes some important changes in the test programs, including files harness_memory.h, test_concurrent_hash_map.cpp, test_concurrent_queue.cpp, and test_task.cpp in the src/test directory.

Conclusion

While the number of lines changed between the previous and the latest commercial aligned releases is relatively small, I advise developers who want to work with the most stable, most fully tested and vetted Threading Building Blocks version to upgrade. The new tbb20_017oss release is now considered the most stable and reliable TBB Version 2.0 that exists.

Kevin Farnham, O'Reilly Media TBB Open Source Community, Freenode IRC #tbb, TBB Mailing Lists

Download TBB

Categories: Open Source, Parallel Programming, Threading Building Blocks

Comments (0)

Trackbacks (0)


Leave a comment  

To obtain technical support, please go to Software Support.
Name (required)*

Email (required; will not be displayed on this page)*

Your URL (optional)


Comment*