I have a set of processes that each need to run on their own background thread at a certain execution rate (3 times a second, once every 10 seconds etc).
I believe CFRunLoop
and/or NSRunLoop
provide this functionality
How do I create (in swift) a new background thread for which to execute a periodic tasks on?
Old post but "background run loop" doesn't equal "background thread" nor does it mean "background queue". Usually there is only one run loop and that is the main thread's run loop. Other threads usually use this run loop but rarely have their own run loop (or their respective run loops are never readily available). To create a run loop for a thread that is not the main thread Apple has a guide and states when this should be done.
Also here is a nice guide I found on run loops in background 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