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

Native & managed code?

uj
Beginner
257 Views

Visual C++allows you to combine native and managed code in the same program. If you do,are there any issues withTBB?

Using the C++/CLI language I've developed a test application which combines classic native C++ with calls to a .NET library called WPF (Windows Presentation Foundation) to build theGUI. This works fine but my concern is that this native/managed mix isincompatible with TBB. It works with OpenMP (according to Microsoft) but I'm not sure whether it extends to TBB as well.

The reason for my concern is this article in Dr. Dobbs Journal,

http://www.ddj.com/cpp/201200614

where James Reinders says "I'd like to do everything at once and tackle Java and .NET now, but since we cannot, I feel good about the decision to start with C++".

0 Kudos
2 Replies
uj
Beginner
257 Views

Well, I guess I've found a reply of sorts here,

http://threadingbuildingblocks.org/codesamples.php

See the Conway's Game of Life example.

0 Kudos
uj
Beginner
257 Views

I've now loaded the above application into Visual C++and I think it's wrongly advertised.

It says it combines native C++ with managed C++/CLI but it doesn't. All files are /clr files which means they're managed. The TBB library is a template library so it will also be linkedas managed. There'snot a trace of native C++ at all in this application.

What you see here is the MS C++/CLI compiler's ability to handle just about anything. In my view this compiler must be the peak of compiler technology.Nothing of this has ever been accomplished before. I hope the people behind this get due credit.

So I will go for it and think it can also handle the native/managed situation as well too.

0 Kudos
Reply