Changes between Version 96 and Version 97 of processus_thread


Ignore:
Timestamp:
May 13, 2018, 2:54:00 PM (3 years ago)
Author:
alain
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • processus_thread

    v96 v97  
    174174This section describes the termination of a process caused by a sys_exit().
    175175
    176  1. The sys_exit() syscall must be executed by the process main thread in (i.e. thread 0 in owner cluster).
    177  1. The sys_exit() function calls the process_sigaction() function that send a multicast, parallel and non blocking RPC to all clusters containing at least one thread of the calling process, to mark for delete all process threads, but the main (calling) thread. This function returns only when all threads (but the main) are blocked and marked for delete.
    178  1. The marked threads will be actually destroyed by the scheduler at the next scheduling point. The remote process descriptor copies are destroyed by the scheduler when the last thread in remote cluster is destroyed.
    179  1. The sys_exit() function set the PROCESS_TERM_EXIT flag in owner process descriptor to synchronize with the parent process, and deschedules.
    180  1. The main thread, and the process descriptor in owner cluster  will be actually destroyed by the scheduler when the parent process sys_wait() function marks this main thread for delete.
     176 1. The sys_exit() syscall can be executed by any thread running in any cluster.
     177 1. The sys_exit() function calls the process_sigaction() function that send a multicast, parallel and non blocking RPC to all clusters containing at least one thread of the calling process, to mark for delete all process threads, but the main thread and the calling thread. This function returns only when all target threads are blocked and marked for delete.
     178 1. These marked threads will be actually destroyed by the scheduler at the next scheduling point. The remote process descriptor copies are also destroyed by the scheduler when the last thread in remote cluster is destroyed.
     179 1. The sys_exit() function blocks and marks for delete the calling thread itself, when it is different from the main thread.
     180 1. The sys_exit() function block the main thread, and set the PROCESS_TERM_EXIT flag in owner process descriptor to ask the parent process (sys_wait function) to mark this main thread for delete, and deschedules. The calling thread will be destroyed at the next scheduling point.
     181 1. The main thread, and the owner process descriptor on one hand, the calling thread and the associated process  will be destroyed by the scheduler at the next scheduling point.
    181182
    182183=== 6.3) detailed kill scenario ===
     
    187188 1. The sys_kill() function calls the process_sigaction() function that send a multicast, parallel and non blocking RPC to all clusters containing at least one thread of the target process, to block all process threads, but the main thread. This function returns only when all threads (but the main) are blocked and descheduled.
    188189 1. The sys_kill() function calls again the process_sigaction() function that send another multicast, parallel and non blocking RPC to the same clusters, to mark for delete all process threads, but the main thread. The marked threads will be actually destroyed by the scheduler at the next scheduling point. The target process descriptor copies are actually destroyed by the scheduler when the last thread in remote cluster is destroyed.
    189  1. The sys_kill() function set the PROCESS_TERM_KILL flag in the target process descriptor in owner cluster to synchronize with its parent process, and returns.
     190 1. The sys_kill() function set the PROCESS_TERM_KILL flag in the target process descriptor in owner cluster to ask synchronize with its parent process, and returns.
    190191 1. The target process main thread, and the target process descriptor in owner cluster  will be actually destroyed by the scheduler when the parent process sys_wait() function marks this main thread for delete.