In Section 4.6(Minimum Number of Timers), it says that
A compliant implementation must allow a MIDlet suite to create a minimum of 5 simultaneously running Timers. This requirement is independent of the minimum requirement specified in Section 3.2 �Minimum Application Thread Count.�
Minimum applicaiton thread count is 10 in section 3.2. So does it mean that at most 50 timers (10 threads * 5 simultaneously running Timers) can be used by a JTWI compliant applcation? In real world application, this kind of application is very less likely to occur... But in theoretical world, will it be possible? :roll:
Originally posted by Mark Spritzler: Actually it is just a straight minimum of 5. Meaning that you can feel safe if you are creating 0-5 Timers at one time and know that a compliant device will not shout and holler at you.
This does not relate to Threads in anyway. How many Threads can be available does NOT have anything to do with the minimum Timers.
Man, try spelling "minimum" over and over again.
Thanks for your explanation, Mark...
but I'm feeling uncomfortable with an application creating 10 threads... That's ok, isn't it? We can create 0-10 threads for an application...
Does it mean that only five of them can create timers so that it's in the bound between 0 and 5 amount of timers, which is theoretically limited for an applicaiton... And other five threads cannot create any timers at all..
Correct me, if my understanding is wrong... I'm also hoping for Sathya to provide some comments on it, cos he did explain me great about the minimum numbers of threads before....
1. A JTWI compliant device must support a minimum of 10 cocurrent threads 2. A JTWI compliant device must support a minimum of 5 timers, INDEPENDENT OF THREAD MINIMUM.
Now, why the bold letters?
Timers are typically implemented by means of a separate thread (something other than the main thread). So, if the specification did not mention the bold-lettered clause, it would mean that the threads used by timers would become a part of spec. 1, which is not the case.
In other worods, what the spec says is,
If the device is JTWI compliant, then it should support at least 15 threads (10 + 5, not 10 * 5), of which, 5 can be exclusively used just to provide timer functionality.
So, an application can expect a JTWI device to support at least 5 timer instances (no guarantees beyond that) and at least 10 application threads (no guarantees beyond that).
Based on this, I can guarantee the following scenarios on a JTWI compliant device
1. My app starts 10 threads and will run properly. 2. My app uses 5 timers and will run properly. 3. My app starts 10 threads and uses 5 timers and will run properly.
The following MAY NOT be guaranteed, although it sounds logical.
1. My app starts 15 threads and does not use any timers. 2. My app uses 15 timers and does not start any threads.