Symbian
Symbian OS Library

FAQ-0498 How do Java thread priorities map to EPOC thread priorities?

[Index][spacer] [Previous] [Next]



 

Classification: Java Category: java.lang
Created: 06/23/2000 Modified: 06/25/2001
Number: FAQ-0498
Platform: Not Applicable

Question:
How do Java thread priorities map to EPOC thread priorities?

Answer:
Java threads typically run with a priority between 1 and 10. EPOC treats Java threads as user threads, for which there exist six distinct priority levels. The mapping of the Java thread priorities to these EPOC thread priorities is carried out according to the following mapping:
int sysThreadSetPriority(sys_thread_t* tid, int priority)
    {
    tid->iThread.SetPriority(java_priority_mapping[priority]);
    return KErrNone;
    }
    static const TThreadPriority java_priority_mapping[11] =
      {
      EPriorityNull,
      EPriorityMuchLess,      // MIN_PRIORITY=1
      EPriorityMuchLess, //+1,
      EPriorityLess,
      EPriorityLess, //+1,
      EPriorityNormal,        // NORM_PRIORITY=5
      EPriorityMore,
      EPriorityMore, //+1,
      EPriorityMuchMore,
      EPriorityMuchMore, //+1,
      EPriorityRealTime       // MAX_PRIORITY=10
      };
      For further details about the TThreadPriority enum,see the EPOC C++ SDK documentation.