Changes between Version 81 and Version 82 of processus_thread
- Timestamp:
- Feb 27, 2018, 4:17:09 PM (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
processus_thread
v81 v82 126 126 The '''thread_kill()''' kernel function is executed by a killer thread that must be different from the target thread, and must be running in the same cluster as the target thread. The killer thread requires the target thread scheduler to do the work at the next scheduling point, by writing in the target thread descriptor, and the target scheduler signals completion to the killer by writing an acknowledge in a specified location in the killer stack. 127 127 128 * To request the kill, the killer thread sets the BLOCKED_GLOBAL bit in the target thread "blocked" field, sets the SIG_KILL bit in the target thread "signals" field, and registers in the target thread "ack_rsp_count"field a pointer on the location where the acknowledge must be written.128 * To request the kill, the killer thread sets the BLOCKED_GLOBAL bit in the target thread ''blocked'' field, sets the SIG_KILL bit in the target thread ''signals'' field, and registers in the target thread ''ack_rsp_count'' field a pointer on the location where the acknowledge must be written. 129 129 * If the target thread is running on another core than the killer thread, the killer thread send an IPI to the core running the target thread, to ask the target scheduler to handle the request. If the target is running on the same thread as the killer, the killer thread calls directly the sched_handle_signal() function. 130 130 * In both cases, the sched_handle_signals() function - detecting the SIG_KILL signal - detach the target thread from the scheduler, detach the target thread from the local process descriptor, detach the target thread from the parent thread if it is attached, release the memory allocated to the target thread descriptor, and atomically decrement the response counter in the killer thread to signal completion.