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 2021/12/21 03:36:29 UTC

[GitHub] [incubator-nuttx] patacongo commented on issue #2663: kthread_create hangs waiting on semaphore while trying to copy file descriptors

patacongo commented on issue #2663:
URL: https://github.com/apache/incubator-nuttx/issues/2663#issuecomment-998443854


   > To me it seems kernel threads should have a different task group struct that excludes at least tg_filelist, tg_streamlist, tg_envsize, and tg_envp. Or at least these should not be initialized for kernel threads. The latter option would be easy, like the band-aid patch I already posted
   You are right.  There is no purpose in having most of those things in a kernel thread since they cannot have pthreads and, hence, can't really have a task group.  See Why Can't Kernel Threads Have pthreads? - NUTTX - Apache Software Foundation. 
   
   
   | 
   | 
   |  | 
   Why Can't Kernel Threads Have pthreads? - NUTTX - Apache Software Founda...
   
   
    |
   
    |
   
    |
   
   
   There are other complications like:  What if a kernel thread creates a user task?  The inheritance of file descriptors, stdio I/O and the environment will get a lot more complex.
   
   The current design does save a lot of code duplication by re-using all of the user-space task structures.
   > It also seems that kernel threads should have their UID and GID set to 0 instead of inheriting it.
   Yes, but there is not fully developed user-based security in the OS so it would end up being mostly cosmetic.
   
   —
   Reply to this email directly, view it on GitHub, or unsubscribe.
   Triage notifications on the go with GitHub Mobile for iOS or Android.
   You are receiving this because you commented.Message ID: ***@***.***>
     


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

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