March 2013
Intermediate to advanced
346 pages
8h 4m
English
There are several options when we want to preserve thread-wide data across functions, including global variables, argument passing, and thread-specific data key. This recipe discusses all the three options with a focus on thread-specific data key.
Readers are recommended to read the Creating and terminating native threads at Android NDK recipe and the Synchronizing native threads with mutex at Android NDK recipe in this chapter before this one.
The following steps will help us create an Android project that demonstrates data management at Android NDK:
NativeThreadsData. Set the package name as cookbook.chapter6.nativethreadsdata. Please ...