From mboxrd@z Thu Jan 1 00:00:00 1970 From: danc@iobjects.com (Dan Conti) To: "Jonathan Larmour" , Subject: RE: [ECOS] Unique priorities Date: Thu, 11 Jan 2001 09:31:00 -0000 Message-id: References: <3A5DE5C4.33B37AA0@redhat.com> X-SW-Source: 2001-01/msg00191.html >From what i can see, it does a ++ on the priority if the given priority is taken (from bitmap.cxx): Cyg_SchedThread_Implementation::Cyg_SchedThread_Implementation ( CYG_ADDRWORD sched_info ) { CYG_REPORT_FUNCTION(); #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) ) priority++; #else // Assign initial priorities to threads in descending order of // creation. static cyg_priority init_priority = 0; priority = init_priority++; #endif } -Dan -----Original Message----- From: ecos-discuss-owner@sources.redhat.com [ mailto:ecos-discuss-owner@sources.redhat.com]On Behalf Of Jonathan Larmour Sent: Thursday, January 11, 2001 8:57 AM To: Jesper Skov Cc: Paleologos Spanos; ecos-discuss@sources.redhat.com Subject: Re: [ECOS] Unique priorities Jesper Skov wrote: > > >>>>> "Paleologos" == Paleologos Spanos 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. Jesper are you sure about that? From bitmap.cxx void Cyg_Scheduler_Implementation::add_thread(Cyg_Thread *thread) { CYG_REPORT_FUNCTION(); CYG_ASSERT((CYG_THREAD_MIN_PRIORITY >= thread->priority) && (CYG_THREAD_MAX_PRIORITY <= thread->priority), "Priority out of range!"); CYG_ASSERT( thread_table[thread->priority] == NULL || thread_table[thread->priority] == thread, "Duplicate thread priorities" ); Jifl -- Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062 Un cheval, pas du glue. Pas du cheval, beaucoup du glue. || Opinions==mine