178 | | 1. The sys_exit() syscall can be executed by any thread running in any cluster. The actual work is done in the owner cluster by the process_make_exit() function, that can be can be directly called by the process main thread (i.e. thread 0 in owner cluster), or can be called by a RPC thread running in the owner cluster, and called by the thread executing the sys_exit() syscall. |
179 | | 1. The process_make_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. The marked threads will be actually destroyed by the scheduler at the next scheduling point. The remote process descriptor copies are actually destroyed by the scheduler when the last thread in remote cluster is destroyed. |
| 178 | 1. The sys_exit() syscall must be executed by the process main thread in (i.e. thread 0 in owner cluster). |
| 179 | 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. |
| 180 | 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. |