public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* RE: [ECOS] Replace eCos idle thread
@ 2003-09-12 10:33 Daniel Lidsten
  2003-09-12 10:42 ` Chris Garry
  0 siblings, 1 reply; 9+ messages in thread
From: Daniel Lidsten @ 2003-09-12 10:33 UTC (permalink / raw)
  To: sandeep, ecos-discuss

> 
> Can you please indicate what kind of situation you have at 
> hand where you don't use time-slicing in eCos and (correct me 
> if i inferred it wrong) have MLQ scheduler with requirements 
> of a idle thread at each level. May be listers can provide 
> better solutions for your situation.
> 
> regards
> sandeep

In my current project i have very close to 32 threads and since i need
them to run on separate priorities then i am starting to hit the roof of
the max number of allowed priorities. Since i have my own idle thread in
the system, which makes some work when the system is idle, then i dont
need the deafult eCos thread. Currently the default eCos thread is just
taking up one priority level which i need to use for other purpose. As i
understand, eCos will start up the idle thread where the function used
is a function within ecos (hal_idle_thread_action). However, in my case
i dont want this thread in the system. 

As i see it, i have two choises. The first is to make a function call
from the default idle thread to the application provided idle thread
function. If i do this then i dont have to startup my own idle thread.
The second alternative is to replace the creation of the default idle
thread and instead let eCos start the idle thread but with my idle
function as an argument....but i dont think that this is possible.

Ideas?

Regards, Daniel Lidsten

--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [ECOS] Replace eCos idle thread
  2003-09-12 10:33 [ECOS] Replace eCos idle thread Daniel Lidsten
@ 2003-09-12 10:42 ` Chris Garry
  2003-09-12 10:45   ` Chris Garry
  2003-09-12 11:06   ` Andrew Lunn
  0 siblings, 2 replies; 9+ messages in thread
From: Chris Garry @ 2003-09-12 10:42 UTC (permalink / raw)
  To: Daniel Lidsten, ecos-discuss

>> 
>> Can you please indicate what kind of situation you have at 
>> hand where you don't use time-slicing in eCos and (correct me 
>> if i inferred it wrong) have MLQ scheduler with requirements 
>> of a idle thread at each level. May be listers can provide 
>> better solutions for your situation.
>> 
>> regards
>> sandeep
>
> In my current project i have very close to 32 threads and since i need
> them to run on separate priorities then i am starting to hit the roof of
> the max number of allowed priorities. Since i have my own idle thread in
> the system, which makes some work when the system is idle, then i dont
> need the deafult eCos thread. Currently the default eCos thread is just
> taking up one priority level which i need to use for other purpose. As i
> understand, eCos will start up the idle thread where the function used
> is a function within ecos (hal_idle_thread_action). However, in my case
> i dont want this thread in the system. 
> 
> As i see it, i have two choises. The first is to make a function call
> from the default idle thread to the application provided idle thread
> function. If i do this then i dont have to startup my own idle thread.
> The second alternative is to replace the creation of the default idle
> thread and instead let eCos start the idle thread but with my idle
> function as an argument....but i dont think that this is possible.
> 
> Ideas?
> 
> Regards, Daniel Lidsten

You could just increase the number of priority levels.
 CYGNUM_KERNEL_SCHED_PRIORITIES

--
Chris

-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [ECOS] Replace eCos idle thread
  2003-09-12 10:42 ` Chris Garry
@ 2003-09-12 10:45   ` Chris Garry
  2003-09-12 10:55     ` Andrew Lunn
  2003-09-12 11:06   ` Andrew Lunn
  1 sibling, 1 reply; 9+ messages in thread
From: Chris Garry @ 2003-09-12 10:45 UTC (permalink / raw)
  To: Daniel Lidsten, ecos-discuss


> >> 
> >> Can you please indicate what kind of situation you have at 
> >> hand where you don't use time-slicing in eCos and (correct me 
> >> if i inferred it wrong) have MLQ scheduler with requirements 
> >> of a idle thread at each level. May be listers can provide 
> >> better solutions for your situation.
> >> 
> >> regards
> >> sandeep
> >
> > In my current project i have very close to 32 threads and since i need
> > them to run on separate priorities then i am starting to hit the roof of
> > the max number of allowed priorities. Since i have my own idle thread in
> > the system, which makes some work when the system is idle, then i dont
> > need the deafult eCos thread. Currently the default eCos thread is just
> > taking up one priority level which i need to use for other purpose. As i
> > understand, eCos will start up the idle thread where the function used
> > is a function within ecos (hal_idle_thread_action). However, in my case
> > i dont want this thread in the system. 
> > 
> > As i see it, i have two choises. The first is to make a function call
> > from the default idle thread to the application provided idle thread
> > function. If i do this then i dont have to startup my own idle thread.
> > The second alternative is to replace the creation of the default idle
> > thread and instead let eCos start the idle thread but with my idle
> > function as an argument....but i dont think that this is possible.
> > 
> > Ideas?
> > 
> > Regards, Daniel Lidsten
> 
> You could just increase the number of priority levels.
>  CYGNUM_KERNEL_SCHED_PRIORITIES
> 

Okay - just spotted 32 is the max allowed.

--
Chris

-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [ECOS] Replace eCos idle thread
  2003-09-12 10:45   ` Chris Garry
@ 2003-09-12 10:55     ` Andrew Lunn
  0 siblings, 0 replies; 9+ messages in thread
From: Andrew Lunn @ 2003-09-12 10:55 UTC (permalink / raw)
  To: Chris Garry; +Cc: Daniel Lidsten, ecos-discuss

> > You could just increase the number of priority levels.
> >  CYGNUM_KERNEL_SCHED_PRIORITIES
> > 
> 
> Okay - just spotted 32 is the max allowed.

Yep, it uses a bitmap in a uint32.

It would take some effort, but you could change this to uint64 so
doubling the number of levels.

If you only ever have one thread per level, you could use the bitmap
scheduler. That is simpler and will take less work to use a uint64.

      Andrew

-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [ECOS] Replace eCos idle thread
  2003-09-12 10:42 ` Chris Garry
  2003-09-12 10:45   ` Chris Garry
@ 2003-09-12 11:06   ` Andrew Lunn
  1 sibling, 0 replies; 9+ messages in thread
From: Andrew Lunn @ 2003-09-12 11:06 UTC (permalink / raw)
  To: Chris Garry; +Cc: Daniel Lidsten, ecos-discuss

> > As i see it, i have two choises. The first is to make a function call
> > from the default idle thread to the application provided idle thread
> > function. If i do this then i dont have to startup my own idle thread.
> > The second alternative is to replace the creation of the default idle
> > thread and instead let eCos start the idle thread but with my idle
> > function as an argument....but i dont think that this is possible.

Im not a C++ expert so this may not be possible....

You could make the eCos idle_thread_main function a weak function
using CYGBLD_ATTRIB_WEAK. You can then put your own implementation
into your application. The linker will then use yours and not eCos's
and will not complain about multiple definitions. 

I've done this with plain C functions in eCos, but i've not tried it
with C++ code. 

     Andrew

-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: [ECOS] Replace eCos idle thread
  2003-09-12  9:48   ` sandeep
@ 2003-09-12 10:23     ` Robert Cragie
  0 siblings, 0 replies; 9+ messages in thread
From: Robert Cragie @ 2003-09-12 10:23 UTC (permalink / raw)
  To: ecos-discuss

As far as I know, the idle thread will only run if all other (higher
priority) threads are blocking and is non-blocking by implication.
Therefore, if you ensure that the thread you create at the lowest priority
is non-blocking, it will effectively become your idle thread.

Robert Cragie, Design Engineer
_______________________________________________________________
Jennic Ltd, Furnival Street, Sheffield, S1 4QT,  UK
http://www.jennic.com  Tel: +44 (0) 114 281 2655
_______________________________________________________________

> -----Original Message-----
> From: ecos-discuss-owner@sources.redhat.com
> [mailto:ecos-discuss-owner@sources.redhat.com]On Behalf Of sandeep
> Sent: 12 September 2003 10:59
> To: ecos-discuss@sources.redhat.com
> Subject: Re: [ECOS] Replace eCos idle thread
>
>
> Hi Daniel,
>
> > > thread? Since i dont have any timeslicing in the system, i put one
> > > thread on each priority which means that i don't want to put my idle
> > > thread on priority 30 so that i have two idle threads.
>
> Are you working with only two priority levels (0-1) ? I wonder
> how could you
> otherwise have only two idle threads while having one idle thread
> being put on
> each priority level.
>
> Can you please indicate what kind of situation you have at hand
> where you don't
> use time-slicing in eCos and (correct me if i inferred it wrong) have MLQ
> scheduler with requirements of a idle thread at each level. May
> be listers can
> provide better solutions for your situation.
>
> regards
> sandeep
>
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.515 / Virus Database: 313 - Release Date: 9/1/2003
>
>
> --
> Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
> and search the list archive: http://sources.redhat.com/ml/ecos-discuss
>
>


-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [ECOS] Replace eCos idle thread
  2003-09-12  9:35 ` Piotr Trojanek
@ 2003-09-12  9:48   ` sandeep
  2003-09-12 10:23     ` Robert Cragie
  0 siblings, 1 reply; 9+ messages in thread
From: sandeep @ 2003-09-12  9:48 UTC (permalink / raw)
  To: ecos-discuss

Hi Daniel,

> > thread? Since i dont have any timeslicing in the system, i put one
> > thread on each priority which means that i don't want to put my idle
> > thread on priority 30 so that i have two idle threads.

Are you working with only two priority levels (0-1) ? I wonder how could you
otherwise have only two idle threads while having one idle thread being put on
each priority level.

Can you please indicate what kind of situation you have at hand where you don't
use time-slicing in eCos and (correct me if i inferred it wrong) have MLQ
scheduler with requirements of a idle thread at each level. May be listers can
provide better solutions for your situation.

regards
sandeep



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.515 / Virus Database: 313 - Release Date: 9/1/2003


-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [ECOS] Replace eCos idle thread
  2003-09-12  7:02 Daniel Lidsten
@ 2003-09-12  9:35 ` Piotr Trojanek
  2003-09-12  9:48   ` sandeep
  0 siblings, 1 reply; 9+ messages in thread
From: Piotr Trojanek @ 2003-09-12  9:35 UTC (permalink / raw)
  To: ecos-discuss

On Fri, Sep 12, 2003 at 09:02:46AM +0200, Daniel Lidsten wrote:
> Hi,
> 
> I would like to provide my own idle thread in the system. Is there any
> way to make ecos startup an application specific function as the idle
> thread? Since i dont have any timeslicing in the system, i put one
> thread on each priority which means that i don't want to put my idle
> thread on priority 30 so that i have two idle threads.
> 
> Regards, Daniel Lidsten

the one way is to check for hal_idle_thread_action (or similar?) in
your HAL package, and change it. I do not know, is this functions exists
in all HALs, but I saw it yesterday in i386 package -- it contains
simple "hlt" asm instruction (for uniprocessor system), so it shouldn't
be hard to provide own replacement.

-- 
Piotr Trojanek

-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [ECOS] Replace eCos idle thread
@ 2003-09-12  7:02 Daniel Lidsten
  2003-09-12  9:35 ` Piotr Trojanek
  0 siblings, 1 reply; 9+ messages in thread
From: Daniel Lidsten @ 2003-09-12  7:02 UTC (permalink / raw)
  To: ecos-discuss

Hi,

I would like to provide my own idle thread in the system. Is there any
way to make ecos startup an application specific function as the idle
thread? Since i dont have any timeslicing in the system, i put one
thread on each priority which means that i don't want to put my idle
thread on priority 30 so that i have two idle threads.

Regards, Daniel Lidsten

--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2003-09-12 11:06 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-12 10:33 [ECOS] Replace eCos idle thread Daniel Lidsten
2003-09-12 10:42 ` Chris Garry
2003-09-12 10:45   ` Chris Garry
2003-09-12 10:55     ` Andrew Lunn
2003-09-12 11:06   ` Andrew Lunn
  -- strict thread matches above, loose matches on Subject: below --
2003-09-12  7:02 Daniel Lidsten
2003-09-12  9:35 ` Piotr Trojanek
2003-09-12  9:48   ` sandeep
2003-09-12 10:23     ` Robert Cragie

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).