Changes between Version 117 and Version 118 of processus_thread


Ignore:
Timestamp:
Nov 3, 2019, 3:28:42 PM (5 years ago)
Author:
alain
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • processus_thread

    v117 v118  
    137137
    138138The scenario is rather simple when the target thread T is not running in ATTACHED mode.
    139 The killer thread (that can be the target thread itself for an exit) calls the thread_delete() function that does the following actions:
     139The killer thread (that can be the target thread itself for an exit) calls the '''thread_delete()''' function that does the following actions:
    140140 * the killer thread sets the [https://www-soc.lip6.fr/trac/almos-mkh/browser/trunk/kernel/kern/thread.h#L82 THREAD_BLOCKED_GLOBAL] bit in the target thread ''blocked'' field,
    141141 * the killer thread sets the [https://www-soc.lip6.fr/trac/almos-mkh/browser/trunk/kernel/kern/thread.h#L76 THREAD_FLAG_REQ_DELETE] bit in the target thread ''flags'' field,
     
    144144=== 5.2) Thread running in ATTACHED mode ===
    145145
    146 The thread destruction is more complex if the target thread T is running in ATTACHED mode, because another joining thread J, executing the  [https://www-soc.lip6.fr/trac/almos-mkh/browser/trunk/kernel/syscalls/sys_thread_join.c pthread_join()]  syscall, must be informed of the termination of thread T. As the '''thread_delete()''' function (executed by the killer thread K) and the '''sys_thread_join()''' (executed by the joining thread J) can be executed in any order, this requires a "rendez-vous": The first arrived thread blocks and deschedules. It will be unblocked by the other thread.
    147 
    148 This destruction mechanism can therefore involve three threads: the target thread T, the killer thread K, and the joining thread J:
     146The thread destruction is more complex if the target thread T is running in ATTACHED mode, because another joining thread J must be informed of the termination of thread T. As the '''thread_delete()''' function (executed by the killer thread K) and the '''sys_thread_join()''' function (executed by the joining thread J) can be executed in any order, this requires a "rendez-vous": The first arrived thread blocks and deschedules. It will be unblocked by the other thread.
     147
     148The destruction mechanism can therefore involve three threads: the target thread T, the killer thread K, and the joining thread J. It
    149149
    150150It uses three specific fields in the target thread descriptor: