Finally: How many Timers Can I Create???

Alex kbyte at iol.pt
Wed Apr 14 09:20:45 UTC 2004


Thanks a lot Dr Joel !!
I will try to do that and then I will share the results with all of us!

This "doubt" arrises because I am trying to execute some tests to the RTEMS behaiviour in some "strange" situations, I mean, the subject will be: 

"How the execution time is affected by the use of some kind/amount of entities"

But One thing I see is that there is no documentation about the rtems internalls and as this is my first time "touching" in rtems there will be these kind of doubts. But I am not thinking in give up! :-)

Thanks once more time to all of you

Alex


----- Mensagem Original -----
De: Joel Sherrill <joel.sherrill at OARcorp.com>
Data: Terça-Feira, 13 de Abril de 2004, 15:34
Assunto: Re: How many Timers Can I Create???

> Alex wrote:
> > It is more clear now for me...
> > So, the my problem is due configuration of rtems itself, right?
> > I have to find out how to change rtems configuration to be 
> possible to create hundreds of timers...
> 
> First you need to modify cpukit/sapi/include/confdefs.h per the
> email I posted yesterday so it accounts for timer resources
> properly.  Here is the URL to that message
> 
> http://www.rtems.com/ml/rtems-users/2004/april/msg00050.html
> 
> Then you simply need to define the CONFIGURE_XXX constant
> appropriately.
> 
> Finally let us all know.
> 
> --joel
> 
> 
> > Thanks to all
> > 
> > Alex
> > 
> > ----- Mensagem Original -----
> > De: Joel Sherrill <joel.sherrill at OARcorp.com>
> > Data: Segunda-Feira, 12 de Abril de 2004, 17:43
> > Assunto: Re: How many Timers Can I Create???
> > 
> > 
> >>Alex wrote:
> >>
> >>
> >>>Ok, but I am still looking to this behaiviour as strange, 
> >>
> >>because the pc I am using has 256 MB of ram and if the rtems see 
> >>memory as a flat fashion, It looks like that rtems is waisting 
> >>memory in timers... Sorry about my statement ... I am beginner 
> in 
> >>rtems, but now I am interesting in find out the reason... I 
> think 
> >>we all!
> >>
> >>>So if with 256 mb rtems only allows to create 10 timers, well 
> If 
> >>
> >>we need 20 timers We have to put ~512 Mb on the PC. It looks 
> very 
> >>strange...
> >>It doesn't matter how much physical RAM is in your target hardware.
> >>What matters is how much you told RTEMS it had available to use.
> >>In the deeply embedded world, one wants tight control over
> >>memory layout and usage.  The amount you want RTEMS to use
> >>is calculated by confdefs.h and it doesn't get a byte more.
> >>Your C program heap may be huge on that PC but RTEMS is
> >>likely being told to use just a handful of kilobytes.
> >>
> >>--joel
> >>
> >>
> >>>Alex
> >>>
> >>>
> >>>
> >>>----- Mensagem Original -----
> >>>De: Joel Sherrill <joel.sherrill at OARcorp.com>
> >>>Data: Segunda-Feira, 12 de Abril de 2004, 17:18
> >>>Assunto: Re: How many Timers Can I Create???
> >>>
> >>>
> >>>
> >>>>Kamen Penev wrote:
> >>>>
> >>>>
> >>>>
> >>>>>Joel Sherrill wrote:
> >>>>>
> >>>>>
> >>>>>
> >>>>>>Alex wrote:
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>>Hi,
> >>>>>>>
> >>>>>>>Does RTEMS has a confifured maximum number o timers it 
> >>>>
> >>>>supports, or 
> >>>>
> >>>>
> >>>>>>>it naturally crashs when too much timers are created?
> >>>>>>>
> >>>>>>>In an test I am doing I have the following:
> >>>>>>>
> >>>>>>>#define CONFIGURE_MAXIMUM_POSIX_TIMERS 150
> >>>>>>>#define CONFIGURE_MAXIMUM_ 150
> >>>>>>>
> >>>>>>>Then I have source code to create 100 timers, but when the 
> >>>>
> >>>>program 
> >>>>
> >>>>
> >>>>>>>starts it hangs, even before starting sreating the first 
> >>>>
> >>>>timer. The 
> >>>>
> >>>>
> >>>>>>>timers are created with the timer_create POSIX function.
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>Sounds like the BSP was unable to assign the memory for that 
> much>>>>>>workspace.
> >>>>>
> >>>>>
> >>>>>
> >>>>>I see this in confdefs.h (ss-20030417):
> >>>>>
> >>>>>#define CONFIGURE_MEMORY_FOR_POSIX_TIMERS(_timers) \
> >>>>>((_timers) * \
> >>>>> ( 0 ) )
> >>>>>
> >>>>>Maybe this is why?
> >>>>
> >>>>That would explain it also. :)
> >>>>
> >>>>I would guess that the proper definitions in
> >>>>cpukit/sapi/include/confdefs.h should be:
> >>>>
> >>>>#define CONFIGURE_MEMORY_FOR_POSIX_TIMERS(_timers) \
> >>>> ((_timers) * sizeof(POSIX_Timer_Control))
> >>>>
> >>>>And since POSIX timers implicitly use a Classic API timer:
> >>>>
> >>>>#define CONFIGURE_MEMORY_FOR_TIMERS(_timers) \
> >>>> ((_timers + CONFIGURE_MAXIMUM_POSIX_TIMERS) * \
> >>>>    ( sizeof(Timer_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
> >>>>
> >>>>My earlier statement about the bspstart.c failing still
> >>>>apply.  But this time you probably got slightly further
> >>>>in initialization before things failed.  RTEMS initialization
> >>>>probably ran out of workspace duging the preallocation of
> >>>>object control blocks.
> >>>>
> >>>>If this works, let us know so a PR can be filed.
> >>>>
> >>>>
> >>>>
> >>>>>Kamen
> >>>>>
> >>>>
> >>>>
> >>>>
> >>___________________________________________________________________________________________> IOL Flash. A net normal em versao acelerada.
> >>
> >>>Promocao: Ligue-se a Internet pelo IOL Flash e ganhe um Vale de 
> >>
> >>€10 da Galp!
> >>
> >>>Saiba como: 
> >>
> >>" 
> target="l">http://www.iol.pt/central_utilizador/iol_flash/promocao.php> 
> >>
> >>
> >>
> > 
> > 
> ___________________________________________________________________________________________> IOL Flash. A net normal em versao acelerada.
> > Promocao: Ligue-se a Internet pelo IOL Flash e ganhe um Vale de 
> €10 da Galp!
> > Saiba como: 
> http://www.iol.pt/central_utilizador/iol_flash/promocao.php> 
> 
> 
> 
___________________________________________________________________________________________
IOL Flash. A net normal em versao acelerada.
Promocao: Ligue-se a Internet pelo IOL Flash e ganhe um Vale de €10 da Galp!
Saiba como: http://www.iol.pt/central_utilizador/iol_flash/promocao.php




More information about the users mailing list