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

Can we add TBB to android library ?

coolsandyforyou
Beginner
1,229 Views
Hi ,
I am planning to port the TBB to Android , to get performance gain on Multi-core processors.

Can i do that? what are the licensing issues.. ?

thanks in advance..
0 Kudos
10 Replies
uj
Beginner
1,229 Views

I've got the impression application developments on Google Android take placeusing Java?

In that case you'll have fine-grainconcurrency ala TBB with Java version 7 (coming upin 2011).

0 Kudos
RafSchietekat
Valued Contributor III
1,229 Views
java -jar Mandelbrot.jar
0 Kudos
coolsandyforyou
Beginner
1,229 Views
Using JNI interface we can call cpp functions....which in turn uses libc....can this be added to libc?

I want to know more in terms of licensing also? can it be merged with android? what r the licensing issues?
0 Kudos
uj
Beginner
1,229 Views

So you're developing in Java right?

It's better torely on the work done by concurrency and Java experts such as Doug Lea. He's written a librarythat adds fine-grain multitasking, very much like TBB,to Java. This library is going to be in integral part ofJavaand fitin smoothly with its design philosophy and existing concurrency features.

My strong adviceis to go with the extended concurrency features offered inJava7. It will be the Java way of doing fine-grain multitasking.

0 Kudos
coolsandyforyou
Beginner
1,229 Views
Thank you UJ..i got ur point...

Out of curiosity i m asking: whether TBB is portable to android? while reading the document it said it can be used any platform which comply with ISO C++ standard cpp library.
In android we have only bionic libc, which is a C library.

0 Kudos
kirill_kornyakov
Beginner
1,229 Views
Hello,
I want to raise the same question. I have read the thread, but we are going to work on native C/C++ level of Android. So, we are not interesting in Java threads, we want to use TBB in our C++ code.
We actually hacked and compiled TBB for Android. It looks like we should implement several low-level platform specific functions to finish the work(atomic operations, operations controlling scheduling, etc). These functions use assembler instructions, such as cmpxchg or mfence. They are implemented as macros or inline functions for each OS and each architecture separately in different header files -- see the folder include/tbb/machine (files linux_ia32.h, linux_ia64.h, windows_ia32.h, sunos_sparc.h, etc).
The whole situation looks optimistic and we can create custom version of TBB, supporting Android. But we don't want to create a fork of TBB of course. Everybody will win if single TBB distibutive will work on every platform.
0 Kudos
Alexey-Kukanov
Employee
1,229 Views

Kirill, would you mind to contribute to us the changes you have made? This will possibly simplify the work to enable TBB on Android.
You may also check whether recently added "generic GCC" port satisifes (some of) your needs; see http://software.intel.com/en-us/forums/showpost.php?p=145743 for details.

0 Kudos
RafSchietekat
Valued Contributor III
1,229 Views
I wrote some code once...
0 Kudos
kirill_kornyakov
Beginner
1,229 Views
Hello, actually our initial version is just a hack. We simply commented all the platform specific code and get TBB compiled for Android. But it was not functional.
Currently, after you message about GCC generics, we decided to try to use them. Finally we get TBB compiled. Even a small TBB sample runs successfully on multicore ARM. BUT TBB can't create several threads and it has been linked statically, because we have some problems with dynamic linkage.
So, we want to solve these issues with threads creation and linkage. Than, in the case of success, we will send you a patch.
0 Kudos
tokiroto
Beginner
1,229 Views
Hey guys, good evening. I've faced with the need to use TBB on Android patform by mixing that with NDK. As i see it is possible to compile and use TBB. Any news ?
0 Kudos
Reply