I have an iOS app, where the UI is written in swift, but all the heavy work is done with a cross platform c++ library. I communicate with the c++ core from swift using a ObjC wrapper.
I wanted to parallelize the work that is happening in the c++ library, using the thread primitives that c++ provides.
But a piece of data is passed into the c++ library from the swift portion of the app, from within a block in a dispatch queue.
My question is, will those threads that I create within the c++ library be separate from the work queue in swift ? From what I understand, it will be. Is that the case ?
Are there any open-source projects which does something similar, or any pitfalls you see with this approach.
The C++ library is a requirement and I can't make it swift only.
will those threads that I create within the c++ library be separate from the work queue in swift ?
The answer is yes. I'm doing the same things for my app. For C++ library, I believe you will create threads with pthread_create()
POSIX call. As found in Apple's doc, POSIX threads are totally legal in iOS and the only way to create joinable threads.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With