blackberry 程序的最大线程数

http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800451/800783/What_Is_-_TooManyThreadsError.html?nodeid=1166538&vernum=0

 

 

原:

A single application can create up to 16 threads. The total number of threads that can exist on a BlackBerry device from all applications is 128. Therefore, if an application has already created 16 threads, the 17th attempt fails and a TooManyThreadsError exception is thrown. Similarly, if there are 128 threads already created on the BlackBerry device and an application attempts to create another thread, a TooManyThreadsError exception is thrown.

 

译:

一个独立的程序可以创建16个线程。 黑莓设备上可以存在的所有线程总数是128。因此,如果一个程序已经创建了16个线程,那么第17个会失败并且抛出TooManyThreadsError 异常。同理,如果黑莓设备上已经创建了128个线程,那么程序再创建新的线程时,异常TooManyThreadsError 也会抛出。

 

————————————————————————————

 

解决:

 最好控制产生线程的个数,使用最少的线程解决最多的问题。

使用线程池,当然线程池也耗用大量资源。

你可能感兴趣的:(thread,application,UP,BlackBerry,黑莓)