Objective C - Regulate GDC thread to limit cpu usage

332 Views Asked by At

i have an app where use xmppframework ( chat system ), to lighten the main thread I moved all data processing on a queue with low priority but it presents a problem, when I receive a large number of chat messages simultaneously are launched n threads ( based on resource ) that lead cpu usage to 100-140% causing the block of UI. How do I adjust the available resources to this queue to prevent the cpu get to these limits?

1

There are 1 best solutions below

0
On

How about just starting a limit amount of threads? Just wait for the other to finish and start a new one everytime one has finished?

This way it is possible for other processes to keep running without any problems.