简体   繁体   中英

Objective C - Regulate GDC thread to limit cpu usage

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM