Community
cancel
Showing results for 
Search instead for 
Did you mean: 
ahfuqq_com
Beginner
47 Views

Could you supply some basic components in tbb, so make tbb can replace pthread llibrary.

Hi, greate tbb engineers,
I have a question: Why don't you supply some basic components in tbb,
such as some kind of classes to envelop pthread_t, pthread_metux_t, pthread_cond_t, pthread_barrier_t, pthread_rwlock_t... and so on.
If there are those classes, I can use tbb to replace pthread library.

I already found I can use tbb::metux to replace pthread_metux_t,
use tbb::spin_metux to replace pthread_spinlock_t.
But didn't found others.

Thanks, and sorry about my poor English.

From a China guy, Ahfu
0 Kudos
1 Reply
RafSchietekat
Black Belt
47 Views

An ancient joke about C++ was that the language is called C++ and not ++C because the language is improved (incremented), but many people still use it as C (the previous value).- H. Sutter, A. Alexandrescu, C++ Coding Standards

Have a look at tbb_thread and {spin,queuing}_rw_mutex. Condition variables and barriers do not really fit TBB, which has a higher-level approach to multithreading. If you have legacy code, you might as well leave them where they are, for now; for new code, try to embrace TBB's concepts instead. Of course, somebody could still decide to include some such objects ahead of C++0x, like with tbb_thread... maybe they already exist ("AJ"?).
Reply