<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Mar 6, 2013 at 11:05 PM, Gedare Bloom <span dir="ltr"><<a href="mailto:gedare@rtems.org" target="_blank">gedare@rtems.org</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I see. So your solution is to add another CONFIGURE option that lets a<br>
user specify the total number of specific keys that might be needed,<br>
i.e. the number of rbtree nodes that can maximally be allocated. I<br>
think this is a fine solution. In the worst case it would still be<br>
threads*keys, but a user can override it. Also, I guess it needs to be<br>
the total threads and not just the pthreads.<br></blockquote><div>Yeah, that's the idea. And the classic API's task is also included by:<br>(CONFIGURE_MAXIMUM_POSIX_THREADS + CONFIGURE_MAXIMUM_TASKS)<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">


<br>
Is it possible for an application developer to know some temporal<br>
properties about the keys that lets them have key_pairs < keys? For<br>
example, I might have two keys and one thread, and I could know that<br>
at any time in my program, the thread only uses one of the keys? In<br>
that case, the key_pairs can be 1? Or is that too far fetched?<br></blockquote><div>it is a good case , the key_pairs can be 1. I just find pthread_setspecific() can't reassign a key to an new value,<br>because it need allocate new rb_node before assign a value, I'm not sure is it a bug or not? The standard seems have no <br>

specification about  this (<a href="http://pubs.opengroup.org/onlinepubs/009604499/functions/pthread_setspecific.html" target="_blank">http://pubs.opengroup.org/onlinepubs/009604499/functions/pthread_setspecific.html</a>). If it is not a bug, <br>

I think the two keys and one thread case is a good case that user can have different key values while keep active key number <br>small(in this case, active key number is one).<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">


<span><font color="#888888"><br>
-Gedare<br>
</font></span><div><div><br>
On Wed, Mar 6, 2013 at 9:37 AM, Ashi <<a href="mailto:ashi08104@gmail.com" target="_blank">ashi08104@gmail.com</a>> wrote:<br>
> Gedare, I'm very sorry to find(just now) there is some work hasn't been<br>
> included in this patch, it is exactly related to confdefs.h,<br>
> because use thread*keys to caculate memory is not very accurate, I introduce<br>
> a key_pair<br>
> variable(<a href="http://www.rtems.org/wiki/index.php/Use_Hash_or_Map_in_POSIX_Key" target="_blank">http://www.rtems.org/wiki/index.php/Use_Hash_or_Map_in_POSIX_Key</a>),<br>
> there are several commits on my<br>
> github(<a href="https://github.com/ashi08104/rtems/commits/one_rbtree" target="_blank">https://github.com/ashi08104/rtems/commits/one_rbtree</a>, commits after<br>
> Aug 28,2012 are related). I'll update the patch as soon as possible.<br>
><br>
><br>
> On Wed, Mar 6, 2013 at 6:12 AM, Gedare Bloom <<a href="mailto:gedare@rtems.org" target="_blank">gedare@rtems.org</a>> wrote:<br>
>><br>
>> ---<br>
>>  cpukit/sapi/include/confdefs.h |    7 ++++++-<br>
>>  1 files changed, 6 insertions(+), 1 deletions(-)<br>
>><br>
>> diff --git a/cpukit/sapi/include/confdefs.h<br>
>> b/cpukit/sapi/include/confdefs.h<br>
>> index cc55e92..fcfdb44 100644<br>
>> --- a/cpukit/sapi/include/confdefs.h<br>
>> +++ b/cpukit/sapi/include/confdefs.h<br>
>> @@ -1713,7 +1713,12 @@ rtems_fs_init_functions_t    rtems_fs_init_helper =<br>
>>    #else<br>
>>      #define CONFIGURE_MEMORY_FOR_POSIX_KEYS(_keys) \<br>
>>        (_Configure_Object_RAM(_keys, sizeof(POSIX_Keys_Control) ) \<br>
>> -        + (_keys) * 3 * _Configure_From_workspace(sizeof(void *) * 2))<br>
>> +        + _Configure_From_workspace( \<br>
>> +          _Configure_Max_Objects(CONFIGURE_MAXIMUM_POSIX_THREADS) \<br>
>> +          * _Configure_Max_Objects(_keys) \<br>
>> +          * sizeof(POSIX_Keys_Rbtree_node) \<br>
>> +        ) \<br>
>> +      )<br>
>>    #endif<br>
>><br>
>>    #ifndef CONFIGURE_MAXIMUM_POSIX_TIMERS<br>
>> --<br>
>> 1.7.1<br>
>><br>
>> _______________________________________________<br>
>> rtems-devel mailing list<br>
>> <a href="mailto:rtems-devel@rtems.org" target="_blank">rtems-devel@rtems.org</a><br>
>> <a href="http://www.rtems.org/mailman/listinfo/rtems-devel" target="_blank">http://www.rtems.org/mailman/listinfo/rtems-devel</a><br>
><br>
><br>
</div></div></blockquote></div><br></div></div>