[ECOS] Unique priorities

Jesper Skov jskov@redhat.com
Thu Jan 11 09:31:00 GMT 2001

>>>>> "Jonathan" == Jonathan Larmour <jlarmour@redhat.com> writes:

Jonathan> Jesper Skov wrote:
>>  >>>>> "Paleologos" == Paleologos Spanos <paleolog@ee.ucla.edu>
>> writes:
Paleologos> mlqueues default scheduler).  I would expect that I would
Paleologos> have an error or something like that because of the fact
Paleologos> that the 2 threads are having the same priority (4).Is it
Paleologos> correct or I have misunderstood something?
>>  The bitmap scheduler will assign a thread the closest possible
>> priority to that requested. It does not fail if the requested
>> priority is already used, it just returns another. So your threads
>> would probably have priorities 4 and 5.

Jonathan> Jesper are you sure about that? From bitmap.cxx

    CYG_ADDRWORD sched_info

#if 1
    // Assign this thread's priority to the supplied sched_info
    // or the next highest priority available.
    priority = cyg_priority(sched_info);

    while( !Cyg_Scheduler::scheduler.unique(priority) )
    // Assign initial priorities to threads in descending order of
    // creation.

    static cyg_priority init_priority = 0;
    priority = init_priority++;

Yup :)  It haunted the stress_threads test for a while as it didn't
get the priorities it had asked for.

But it's not good that those two are not consistent. File a bug?


More information about the Ecos-discuss mailing list