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 |
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. |
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.
|
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. |
Re: How many simultaneous threads can work together?
Thanks
|
All times are GMT -5. The time now is 09:43 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.