[ECOS] problem in thread creation and scheduling
Fri Dec 3 05:42:00 GMT 2004
Yes I realized that mapping the priority levels to a narrower range might
have that effect. However, we are only using certain fixed priorities like
10, 75, 100, etc., so it won't matter for our code. Thanks a lot for
pointing it out though!
By the way, we wish to port a section of our code where the Windows portion
creates a named pipe using 'CreateNamedPipe()' and the VxWorks portion
creates a simple TTY-type terminal using 'ptyDevCreate().' The aim is to
implement some kind of Telnet service on the system. Can you suggest any
appropriate eCos function for the same? One option suggested was to create
message boxes for the eCos portion, using 'cyg_mbox_create().' Will this
serve the purpose? We tried to set a TTY interface using the eCos TTY
functions, but didn't get too far as it didn't seem to fit in.
----- Original Message -----
From: "Andrew Lunn" <firstname.lastname@example.org>
To: "Vijay Padiyar" <email@example.com>
Cc: "eCos Support" <firstname.lastname@example.org>
Sent: Thursday, December 02, 2004 6:50 PM
Subject: Re: [ECOS] problem in thread creation and scheduling
> On Thu, Dec 02, 2004 at 06:37:44PM +0530, Vijay Padiyar wrote:
> > Hi Nick
> > Hey yeh you were right! Somehow we overlooked the vital fact that the
> > priority levels need to be between 0 and 31 for eCos!!! Actually we're
> > developing code to run on both VxWorks and eCos, so we have common
> > that are passed to the equivalent functions in all the files. Here, we
> > passed the 'priority' variable directly to 'cyg_thread_create()' without
> > realizing that its value ranges between 0 and 255.
> > I now added the following lines to my code:
> > #ifdef ECOS
> > ..
> > priority = (int)(priority/8);
> This might not be the best solution, depending on your code. You
> might find somebody has written code which uses the fact that VxWorks
> priority 9 and 10 are different. With eCos this will not be true. You
> probably need to check all your code to see how prorities are actually
> used. You might need to map each unique priority your application is
> using to a unique eCos priority.
> > ..
> > cyg_thread_create(priority,...)
> > ..
> > #endif
> I suggest you enable assertions. eCos will then tell you about things
> like this where you are using the API wrongly.
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
More information about the Ecos-discuss