Changes between Version 54 and Version 55 of processus_thread


Ignore:
Timestamp:
Dec 8, 2017, 12:48:32 AM (7 years ago)
Author:
alain
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • processus_thread

    v54 v55  
    141141 * The scheduler, detecting the SIG_SUICIDE bit, detach the thread from the scheduler, detach the thread from the local process descriptor, and releases the memory allocated to the thread descriptor.
    142142
    143 == 5.3) thread_exit() when ATTACHED ===
     143=== 5.3) thread_exit() when ATTACHED ===
    144144
    145145The thread_exit() scenario is more complex if the finishing thread T is running in ATTACHED mode, because another - possibly remote - PT thread, executing the ''pthread_join'' system call, must be informed of the exit of thread T. As the ''pthread_exit'' can happen before of after the ''pthread_join'', this requires a synchronisation: The first arrived thread block and deschedule, and must be reactivated by the other thread. This synchronisation uses three specific fields in the thread descriptor: the "join_lock" field is a remote_spin_lock; the "join_value" field contains the exit value returned by the finishing thread T; the "join_xp"field contains an extended pointer on the PT thread that wants to join. The scenario is the following: