Martin Erhardt
Martin Erhardt

Reputation: 581

Are there any stable native threading APIs for Android?

I am going to make an android game engine, primary using native C++. I want to use threading and I don't want to implement it in Java, because of the JNI's slowness. Are there any stable native threading APIs for Android, I could use?

Upvotes: 2

Views: 2567

Answers (3)

justin
justin

Reputation: 104698

Try using pthreads in libpthread

Upvotes: 1

Jasper Blues
Jasper Blues

Reputation: 28756

I did some research on the topic (threading support in Android NDK) today, and it seems the options are as follows:

  1. C++11 has native threading support on Android

  2. Posix Threads (aka pthread).

  3. Boost is available on Android, and includes threading support.

  4. Poco is available on Android, and includes threading support.

Upvotes: 6

gfour
gfour

Reputation: 999

You can also try the threads (Boost.Thread) of Boost for Android.

I don't want to implement it in Java, because of the JNI's slowness

According to the first post here, going native is not always going to make your code run faster (you may be still calling Java code from your C++ under the hood).

Upvotes: 0

Related Questions