BlackBerry Forums Support Community

BlackBerry Forums Support Community (http://www.blackberryforums.com/)
-   Developer Forum (http://www.blackberryforums.com/developer-forum/)
-   -   How many simultaneous threads can work together? (http://www.blackberryforums.com/developer-forum/263888-how-many-simultaneous-threads-can-work-together.html)

abhsax1978@hotmail.com 03-26-2013 01:40 AM

How many simultaneous threads can work together?
 
I have 5 (services tasks) to do simultaneously.
Now when I introduce a sixth one (Timer tasks: either scheduled once or at fixed rate), it is blocked.
Though I can run that service in an existing task, but that is synchronous: unless and untill the other subtask is finished, you can not continue with this required new service task.

I want to know whethere there is a limitation on number of simultaneous working threads?

Though I have a threaded que as well, but that is also imposing a wait..
I know of thread pool executors as well, but that is not backward compatible..

Please enlighten me with the knowledge of concurrent threads in Blackberry.

Regards

Dougsg38p 03-27-2013 12:24 PM

Re: How many simultaneous threads can work together?
 
TimerTask uses a single scheduler thread, AFAIK.

Don't confuse threads and timer-task tasks - two different things.

There is a system-wide limit to the number of threads - and this depends on the device and the OS level. Usually it is around 20 threads.

Dougsg38p 03-27-2013 02:01 PM

Re: How many simultaneous threads can work together?
 
One other issue that occurred to me: a long running task will keep subsequent tasks from executing. You might want to consideer using the timer to simple start a thread in your own process, then return immediately to timer. This would allow you to have overlapping timer-executed tasks.

abhsax1978@hotmail.com 04-08-2013 11:05 PM

Re: How many simultaneous threads can work together?
 
Hello,
I have corrected this by using a different instance of task every time. Otherwise it will not run, because the task is already finished.
Timer-Task gives me the liberty to cancel the execution, and re-initialize using the same Timer object.
I have a control-panel also to start and stop the tasks that I select.

abhsax1978@hotmail.com 04-08-2013 11:07 PM

Re: How many simultaneous threads can work together?
 
Thanks


All times are GMT -5. The time now is 10:47 PM.

Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.