Create threads from send queue block [swift / c ++]

I have an iOS app where the user interface is written fast, but all the hard work is done using the cross-platform C ++ library. I am linking to the C ++ kernel from swift using the ObjC wrapper.

I wanted to parallelize the work that happens in the C ++ library using the stream primitives that C ++ provides.

But part of the data is transferred to the C ++ library from the fast part of the application from within the block in the send queue.

My question is: will those flows that I create in the C ++ library be separate from the work queue in swift? As I understand it, it will be so. This is true?

Are there any open source projects that do something similar, or any errors you see with this approach.

The C ++ library is a requirement, and I cannot make it fast.

+5
source share
1 answer

Will the threads that I create in the C ++ library be separate from the work queue in swift?

The answer is yes. I am doing the same for my application. For the C ++ library, I believe that you will create threads with the pthread_create() call of POSIX. As shown in the Apple doc , POSIX streams are completely legal in iOS and the only way to create streams with connectivity.

+3
source

Source: https://habr.com/ru/post/1275092/


All Articles