per task variables was Re: M68k C++ Exceptions working!

Joel Sherrill joel.sherrill at OARcorp.com
Fri Jan 14 19:47:36 UTC 2000


Eric Valette wrote:
> 
> Joel Sherrill wrote:
> 
> >   + use the --enable-cplusplus configure option to add this context
> >     switch to each task.  OR
> 
> Sorry to jump in but I may add the following (especially regarding the
> recent discussion on the interrupt void* argument to hanlder). A single
> per thread data software register is usually usefull for multi-thread
> programming. It enables thread executing the same code to store and get
> information that is thread specific while not being contained in the
> current language local variables scope. This is very similar to having
> several interrupt handler executing the same code BUT some per board
> specific data (with the notable exception that there is no slocal
> variable scope for the primary handler). A single registers can then be
> multiplexed by libraries/managers needing to store thread specific info
> without seraching a table by the ID of the thread.
> 
> This feature is available at least in ChorusOs and probably in other
> RTOS as well...

And RTEMS... at Eric Norum's request (and starting with his
implementation)
these have been added.  They are called "per task variables" with RTEMS.
Each interested thread registers using rtems_task_variable_add.  These
"void *" memory locations are then logically added to that task's
context area.  The prototype is:

rtems_status_code rtems_task_variable_add(
  rtems_id tid,
  int *ptr
);

And no it has not been in the source an enormously long time. The 
files were added to CVS back in November.


> --
>    __
>   /  `                          Eric Valette
>  /--   __  o _.                 Canon CRF - Communication Dept
> (___, / (_(_(__                 Rue de la touche lambert
>                                 35517 Cesson-Sevigne  Cedex
>                                 FRANCE
> Tel: +33 (0)2 99 87 68 91       Fax: +33 (0)2 99 84 11 30
> E-mail: valette at crf.canon.fr    http://www.crf.canon.fr

-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel at OARcorp.com                 On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
   Support Available             (256) 722-9985



More information about the users mailing list