Configuration define statement for using pthread_key_create().

Joel Sherrill joel.sherrill at OARcorp.com
Tue Apr 15 15:54:48 UTC 2014


On 4/15/2014 7:39 AM, Sebastian Huber wrote:
> On 2014-04-15 14:37, Joel Sherrill wrote:
>> On Apr 15, 2014 6:11 AM, Sebastian Huber <sebastian.huber at embedded-brains.de>
>> wrote:
>>  >
>>  > On 2014-04-15 13:08, Sebastian Huber wrote:
>>  > >> Case 2.
>>  > >> #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
>>  > >> #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
>>  > >> #define CONFIGURE_UNLIMITED_OBJECTS
>>  > >
>>  > > In case of unlimited objects you should also use:
>>  > >
>>  > > #define CONFIGURE_UNIFIED_WORK_AREAS
>>  > >
>>  > >> #define CONFIGURE_POSIX_INIT_THREAD_TABLE
>>  > >> #define CONFIGURE_INIT
>>  > >> #include <rtems/confdefs.h>
>>  >
>>  > I just realized that the unlimited objects support is broken for POSIX keys.
>>  > So you should use Case 1.
>>
>> Which part do you think is broken? The move to rbtree implementation removed
>> the issue with more threads being added. You can still run out of key/value
>> pairs but keys work with unlimited threads.
>>
> In confdefs.h we have:
>
> [...]
>    #ifdef RTEMS_POSIX_API
>      #if !defined(CONFIGURE_MAXIMUM_POSIX_THREADS)
>        #define CONFIGURE_MAXIMUM_POSIX_THREADS \
>          rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE)
>      #endif
>      #if !defined(CONFIGURE_MAXIMUM_POSIX_MUTEXES)
>        #define CONFIGURE_MAXIMUM_POSIX_MUTEXES \
>          rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE)
>      #endif
>      #if !defined(CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES)
>        #define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES \
>          rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE)
>      #endif
> /*
>      #if !defined(CONFIGURE_MAXIMUM_POSIX_KEYS)
>        #define CONFIGURE_MAXIMUM_POSIX_KEYS \
>          rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE)
>      #endif
> */
>      #if !defined(CONFIGURE_MAXIMUM_POSIX_TIMERS)
>        #define CONFIGURE_MAXIMUM_POSIX_TIMERS \
>          rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE)
>      #endif
> [...]
>
That is stupid looking. I wonder why that is the case. :(

Doesn't seem right. May be a remnant from before the switch to rbtree

-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel.sherrill 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