Can we use pthread instead of NSThread in iPhone apps

Well, I have an application that uses both Objective-C and C ++, but for portability reasons, I tried to use C ++ as much as possible ... Now I am faced with some problem that requires threads that I was thinking about using pthreadinstead NSThread... Is it good to use pthread? Will Apple punish me for using it by rejecting my app in the appstore ...?

+3
source share
3 answers

NSThreadbuilt around pthreadanyway

I see no reason why the use pthreadwill lead to the abandonment of part of Apple

+7
source

NSThread is basically a shell of pthread semantics.

Benefits: - Notification NSThreadWillExitNotification when exiting NSThread - Local thread storage NSMutableDictionary

Limitations: - you can only create individual NSThreads

Remember that Cocoa needs to know that you want to do multithreading. It is important to disconnect the dummy NSThread first so that the application can be considered multithreaded .

+3
source

API pthread, SCHED_OTHER SCHED_FIFO . .

Cocoa touch framework API , pthread NSThread.

+1
source

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


All Articles