You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2020/05/08 15:35:49 UTC

[GitHub] [incubator-nuttx] patacongo opened a new pull request #1007: Move pthread-specific data into TLS

patacongo opened a new pull request #1007:
URL: https://github.com/apache/incubator-nuttx/pull/1007


   ## Summary
   
   1. Move pthread-specific data files from sched/pthread/ to libs/libc/pthread.
   2. Remove pthread-specific data functions from syscalls.
   3. Implement tls_alloc() and tls_free() with system calls.
   4. Reimplement pthread_key_create() and pthread_key_free() using tls_alloc() and tls_free().
   5. Reimplement pthread_set_specific() and pthread_get_specicif() using tls_set_value() and tls_get_value()
   
   ## Impact
   
   Should have no impact on any users.  There are are changes to the way that pthread-specific data is use and in the event of undiscovered bugs, those would cause an impact as well.
   
   ## Testing
   
   sim:ostest
   
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] Ouss4 commented on a change in pull request #1007: Move pthread-specific data into TLS

Posted by GitBox <gi...@apache.org>.
Ouss4 commented on a change in pull request #1007:
URL: https://github.com/apache/incubator-nuttx/pull/1007#discussion_r422247730



##########
File path: libs/libc/tls/Kconfig
##########
@@ -45,10 +45,11 @@ config TLS_LOG2_MAXSTACK
 
 config TLS_NELEM
 	int "Number of TLS elements"
-	default 0
+	default 4

Review comment:
       This means that TLS (and pthread-specific) is always enabled? (for defconfigs that don't set it to 0 as above)
   BTW, the CONFIG_NPTHREAD_KEYS is not used anymore it should be removed from sched/Kconfig.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] patacongo commented on a change in pull request #1007: Move pthread-specific data into TLS

Posted by GitBox <gi...@apache.org>.
patacongo commented on a change in pull request #1007:
URL: https://github.com/apache/incubator-nuttx/pull/1007#discussion_r422252676



##########
File path: libs/libc/tls/Kconfig
##########
@@ -45,10 +45,11 @@ config TLS_LOG2_MAXSTACK
 
 config TLS_NELEM
 	int "Number of TLS elements"
-	default 0
+	default 4

Review comment:
       Yes, this was for backward compatibility.  When TLS and pthread-specific data were merged, the the old CONFIG_NPTHREAD_KEYS was replaced with CONFIG_TLS_ELEM since TLS is now the underlying mechanism.  In order to be backward compatible with existing defconfig files, CONFIG_TLS_NELEM must have the same default as CONFIG_PTHREAD_KEYS used to have, that is four.
   
   In most defconfig files, pthread-specific data is disabled like:
   
       -CONFIG_NPTHREAD_KEYS=0
       +CONFIG_TLS_NELEM=0
   
   So there will be no impact to the the behavior of any of the configurations.  So although this looks weird, this is the correct default to have absolutely no impact on the existing configurations.
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org