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