From: Nick Garnett <nickg@cygnus.co.uk>
To: ecos-discuss@sourceware.cygnus.com
Subject: Re: [ECOS] Unique priorities
Date: Thu, 11 Jan 2001 09:15:00 -0000 [thread overview]
Message-ID: <wwghf36xb9i.fsf@balti.cambridge.redhat.com> (raw)
In-Reply-To: <3A5DE5C4.33B37AA0@redhat.com>
Jonathan Larmour <jlarmour@redhat.com> writes:
> 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.
>
> 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" );
>
Yes, here's the code:
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
}
--
Nick Garnett, eCos Kernel Architect
Red Hat, Cambridge, UK
next prev parent reply other threads:[~2001-01-11 9:15 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-01-10 16:25 Paleologos Spanos
2001-01-10 23:53 ` Jesper Skov
2001-01-11 8:56 ` Jonathan Larmour
2001-01-11 9:15 ` Nick Garnett [this message]
2001-01-11 9:31 ` Dan Conti
2001-01-11 9:31 ` Jesper Skov
2001-01-11 9:35 ` Jonathan Larmour
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=wwghf36xb9i.fsf@balti.cambridge.redhat.com \
--to=nickg@cygnus.co.uk \
--cc=ecos-discuss@sourceware.cygnus.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).