Christopher Creutzig
Christopher Creutzig

Reputation: 8774

From explicit threading to TBB

Assuming I have a parallel algorithm that uses explicit threading with one or two locks for synchronization and is optimized to take advantage of cache lines (including shared L3 cache between multiple cores), what are good ways of incorporating that into a TBB program? The algorithm in question does not break down as nicely into tasks as it does into threads.

Upvotes: 3

Views: 102

Answers (1)

Leonardo
Leonardo

Reputation: 11391

Without any further information (code sample, or any kind of generic presentation of the algorithm, such as a flowchart) I would say that the best way to make such transition is by refactoring the algorithm, isolating repeatable actions and trying to combine them in tasks (a range of one or more activities that have a common purpose)...

unfortunately there's no magical formula to make this transition because these techniques are fundamentally 2 answers to solve the same problem, therefore they share some common ground, but they also tackle the problem from 2 different angles...

Upvotes: 1

Related Questions