Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doubt in JTWI 1.0 Specification

 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:

Any comments are welcome...
 
Alibabra Sanjie
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
...So does it mean that at most 50 timers (10 threads * 5 simultaneously running Timers)...


Could you further explain how you get this formula: 10 threads * 5 = 50 timers?
[ September 03, 2004: Message edited by: Alibabra Sanjie ]
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We can have minimum of 5 threads for each application, isn't it? Each thread can create minimum of 10 Timers... Then 5 * 10 = 50 timers can be running in an application...

How do u think? Thanks...
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.


Mark
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.


Mark


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....
 
Sathya Srinivasan
Ranch Hand
Posts: 379
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

My understanding is as follows.

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.

Hope this helps.

Best Wishes,
Sathya Srinivasan.
 
Alibabra Sanjie
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Very clear!
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nice explanation and the examples are great too... Thanks a million, Sathya...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic