05-24-2012 12:02 PM
Is there a (simple and easy-to-comprehend) example of running a process in a thread. I am a Java developer and I have read tons of documentation on c threads, but its pretty much greek to me and I don't know anything about what libraries are available on the PB. I coiuld use an example that works on the PlayBook.if such an animal exists.
Solved! Go to Solution.
05-24-2012 03:20 PM
Are you using Qt? Then you could use QThread. Examples could be found everywhere. With normal NDK I don't know how todo it.
Thanks. I need an example that will work with the "normal" NDK.. I am trying to write an ActionScript Native Extension (ANE) so I suppose it could be either c or c++ as long as it demonstrates usage of a threading library that is available on PlayBook. I need to run the BPS sensor event loop in a thread so that it does not lock up the main ANE threaqd. As I said in the previous post I am an experienced Java developer and I am a complete novice when it comes to c.
05-24-2012 03:46 PM
The Channels Sample on GitHub shows a PlayBook app using pthreads.
05-24-2012 03:47 PM
I'm also a java developer. So Qt and QtCreator are quite good for me. Qt ist easy to learn for a java guy.
This may be true but it doesn't help me in this particular situation. I am not looking for a general-purpose app framework. Rather I am writing an extension for my Air app and whatever I use must coexist with the Adobe-provided API. QT may very well work if ihas a standalone native threading library and if you can tell me how to use it in my.native extension.
05-24-2012 03:48 PM - edited 05-24-2012 04:14 PM
PlayBook uses POSIX standard pthreads. An internet search for 'pthreads' turns up a number of tutorials.
Thanks, this is the information that I need. I'll have a look.
Edit: I found a good tutorial on pthreads here:along with some examples: