Changes between Version 21 and Version 22 of processus_thread


Ignore:
Timestamp:
Jul 15, 2016, 8:08:29 PM (8 years ago)
Author:
alain
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • processus_thread

    v21 v22  
    2323There is a partial list of informations stored in a process descriptor (process_t in ALMOS-MK):
    2424- '''PID''' :  proces identifier.
    25 - '''PPID''' : parent process identifier,
    26 - '''XMIN, YMIN, XMAX, YMAX''' : rectangle covering all active clusters.
     25- '''PPID''' : parent process identifier,
    2726- '''PREF''' : extended pointer on the reference process descriptor.
    2827- '''VMM''' : virtual memory manager containing the PG_TBL and the VSEG_LIST.
     
    126125== __5) Thread destruction__ ==
    127126
    128 The destruction of a thread T running in cluster K can be caused by the thread itself, with the pthread_exit() system call. It can also be caused by a kill signal, went by anothprthread,  requesting the thread to stop execution. In both case, the host kernel K is in charge of the destruction. The scenario is more complex if the finishing thread T is running in ATTACH mode, because the parent thread TP must be informed of the completion of thread T, in case of pthread_join() executed by TP.
     127The destruction of a thread T running in cluster K can be caused by the thread itself, with the pthread_exit() system call. It can also be caused by a kill signal, sent by another thread,  requesting the thread to stop execution. In both case, the host kernel K is in charge of the destruction. The scenario is more complex if the finishing thread T is running in ATTACH mode, because the parent thread TP must be informed of the completion of thread T, in case of pthread_join() executed by TP.
    129128
    130129=== 5.1) phase 1 ===
     
    141140In each cluster, a dedicated kernel thread is in charge of housekeeping: This thread releases the memory allocated to all DEAD threads.
    142141
    143 == __5) Destruction d’un processus__
     142== __5) Process destruction__ ==
     143
     144The process destruction can be caused by an exit() system call, or by asignal send by another process.
     145In both case, the owner cluster is in charge of the destruction.
    144146
    145147=== 5.1) phase 1 ===
    146148
    147 Si l’appel système exit() est exécuté sur un cluster K différent du cluster Z propriétaire, le noyau du cluster K envoie une TASK_EXIT_RPC vers le cluster Z propriétaire.
    148 L’argument est le PID du processus P.
     149If the exit() system call is executed by a thread running in a cluster K different from the owner cluster Z, the kernel K send a RPC_PROCESS_REQ_EXIT to cluster Z. The argument is the PID.
    149150
    150151=== 5.2) phase 2 ===
    151152
    152 Pour exécuter la TASK_EXIT_RPC, le noyau du cluster Z propriétaire de P broadcaste une TASK_EXIT_RPC vers tous les clusters M qui contiennent au moins un thread du processus P.
    153 Dans chaque cluster M, le noyau recevant une TASK_EXIT_RPC enregistre le signal KILL dans les descripteurs detous les threadsde P.
    154 Quand il détecte que la TRDL(P,M) est vide, il libère toutes les structures de données allouées au processus P dans le cluster M, et retourne la réponse au cluster Z.
     153To execute this RPC, the owner kernel Z send a multi-cast  RPC_PROCESS_EXIT to all clusters X that contain a copy of the process descriptor, using its COPIES_LIST. The argument of this RPC is the PID.
    155154
    156155=== 5.3) phase 3 ===
    157156
    158 Lorsque toutes les réponses au TASK_EXIT_RCP ont été reçues par le cluster Z, celui-ci libère toutes les structures
    159 de données allouées au processus P dans le cluster Z.
     157In each cluster X, the kernel receiving a RPC_PROCESS_EXIT register the kill signal in all threads descriptors associated to the PID process. and polls the local TH_TBL(X,P). When it detects that the TH_TBL(X,P) is empty, it releases the memory allocated to process descriptor, and acknowledges the RPC to cluster Z.
     158
     159=== 5.4) phase 4 ===
     160
     161When the kernel Z has received all expected responses to the multi-cast RPC, it releases all memory located to process PID in cluster Z, and this completes the process destruction.