Intel® oneAPI Threading Building Blocks
Ask questions and share information about adding parallelism to your applications when using this threading library.

TBB and Nehalem

tbbnovice
Beginner
314 Views

I read this on xtremetech:

"Fast, unaligned cache access-Before Nehalem, data needed to be aligned on cache line boundaries for maximum performance. That's no longer true with Nehalem. This will help newer applications written for Nehalem, more than older ones, only because compilers and application authors often took great care to align data along cache line boundaries."

Does this mean that I wouldn't need to use the scalable allocator if I am running my app on Nehalem? Or do I still have a penalty if I use the default new? Thanks in advance.

0 Kudos
4 Replies
Anton_Pegushin
New Contributor II
314 Views
Quoting - tbbnovice

I read this on xtremetech:

"Fast, unaligned cache access-Before Nehalem, data needed to be aligned on cache line boundaries for maximum performance. That's no longer true with Nehalem. This will help newer applications written for Nehalem, more than older ones, only because compilers and application authors often took great care to align data along cache line boundaries."

Does this mean that I wouldn't need to use the scalable allocator if I am running my app on Nehalem? Or do I still have a penalty if I use the default new? Thanks in advance.

I'm not sure how these two things - caching mechanisms improvements on Nehalem and TBB Scalable Allocator -are connected actually based on that quote you give. From what I understand the short answer to your question is: if an application benefited from using TBB Scalable Allocator on non-Nehalem platform, it should continue benefitting from using it on Nehalem platform.

0 Kudos
Dmitry_Vyukov
Valued Contributor I
314 Views
Quoting - tbbnovice

I read this on xtremetech:

"Fast, unaligned cache access-Before Nehalem, data needed to be aligned on cache line boundaries for maximum performance. That's no longer true with Nehalem. This will help newer applications written for Nehalem, more than older ones, only because compilers and application authors often took great care to align data along cache line boundaries."

Does this mean that I wouldn't need to use the scalable allocator if I am running my app on Nehalem? Or do I still have a penalty if I use the default new? Thanks in advance.

This depends on your platform (what is "new" on your platform). And it has nothing to do with Nehalem. If your platform provides bad multi-threaded malloc (like, for example, MSVC8/9+Windows XP), then you better use tbb::scalable_malloc. In MSVC2010 they are promising good multi-threaded malloc.

Unaligned memory access have nothing to do with memory allocation scalability in multi-threaded environment.

0 Kudos
AJ13
New Contributor I
314 Views

The idea of cache-lines not mattering anymore seems very odd to me....

0 Kudos
ARCH_R_Intel
Employee
314 Views
I believe that the Nehalem improvement applies when both cache lines are present. A cache miss is still expensive. Hence it is still important to considerhow shared data is packed into cache.
0 Kudos
Reply