Changeset 416 for trunk/kernel/kern/thread.h
- Timestamp:
- Jan 4, 2018, 10:05:47 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/kern/thread.h
r409 r416 72 72 #define THREAD_FLAG_JOIN_DONE 0x0002 /*! Parent thread made a join */ 73 73 #define THREAD_FLAG_SCHED 0x0004 /*! Scheduling required for this thread */ 74 #define THREAD_FLAG_SIGNAL 0x0004 /*! Acknowledge of descheduling required */ 74 #define THREAD_FLAG_REQ_ACK 0x0008 /*! Acknowledge required from scheduler */ 75 #define THREAD_FLAG_REQ_DELETE 0x0010 /*! Destruction required by scheduler */ 75 76 76 77 /*************************************************************************************** … … 119 120 * - The TRDID 16 MSB bits contain the CXY of cluster containing the thread. 120 121 * - The LTID is used to index the th_tbl[] array in the local process descriptor. 121 * This TRDID is computed by the process_register_thread() function, when the user122 _* This TRDID is computed by the process_register_thread() function, when the user 122 123 * thread is registered in the local copy of the process descriptor. 123 124 * … … 153 154 xptr_t join_xp; /*! extended pointer on joining thread */ 154 155 155 uint32_t * sig_rsp_count; /*! pointer on signal response counter*/156 uint32_t * ack_rsp_count; /*! pointer on acknowledge response counter */ 156 157 157 158 intptr_t u_stack_base; /*! user stack base address */ … … 345 346 346 347 /*************************************************************************************** 347 * This function is used by a killer thread running in the same cluster as a target348 * thread to request the scheduler of the target t o call the thread_handle_signal()349 * at the next context switch, to confirm that the target thread is blocked and350 * not currently running.This function executes atomically the following actions :351 * - it set the sig_pending flagin the target scheduler descriptor.352 * - it set the SIGflag in the "flags" field of the target thread descriptor.348 * This function is used by a "blocker" thread running in the same cluster as a "target" 349 * thread to request the scheduler of the target thread to acknowledge that the target 350 * thread is blocked and not running, at the next context switch. 351 * This function executes atomically the following actions : 352 * - it set the request_pending boolean in the target scheduler descriptor. 353 * - it set the REQ_ACK flag in the "flags" field of the target thread descriptor. 353 354 * - It registers the responses counter pointer in the target thread descriptor. 354 * The sig_pending flag is handled as a set/reset flip-flop by the killerthread355 * and by the targetscheduler.355 * The request_pending flag is handled as a set/reset flip-flop by the "blocker" thread 356 * and by the "target" scheduler. 356 357 *************************************************************************************** 357 358 * @ target : local pointer on target thread. 358 * @ sig_rsp_count : local pointer on responses counter.359 **************************************************************************************/ 360 void thread_set_ signal( thread_t * thread,361 uint32_t * sig_rsp_count );362 363 /*************************************************************************************** 364 * This function is used by the sched_handle_signal() function executed by a scheduler365 * to reset a pending signal in both a target <thread> descriptor, and in the target366 * thread scheduler.367 *************************************************************************************** 368 * @ t hread: local pointer on target thread.369 **************************************************************************************/ 370 void thread_reset_ signal( thread_t * thread);359 * @ ack_rsp_count : local pointer on responses counter. 360 **************************************************************************************/ 361 void thread_set_req_ack( thread_t * target, 362 uint32_t * ack_rsp_count ); 363 364 /*************************************************************************************** 365 * This function is used by the sched_handle_signal() function executed by the 366 * scheduler of a "target" thread to reset a "blocked not running" acknowledge request 367 * in both the target thread descriptor, and in the target thread scheduler. 368 *************************************************************************************** 369 * @ target : local pointer on target thread. 370 **************************************************************************************/ 371 void thread_reset_req_ack( thread_t * target ); 371 372 372 373 /*************************************************************************************** … … 390 391 * If not, the client thread must use the RPC_THREAD_KILL. 391 392 * - When the killer thread is running on the same core as the target thread, 392 * This function simply detach the target thread from the scheduler, 393 * detach it from the parent thread if it is attached, detach it from the 394 * local process descriptor, and rrleases all memory allocated to the thread. 395 * - When the killer thread is running on a different core than the target thread 396 * The killer send a signal to the target thread scheduler requesting this 397 * scheduler to confirm that the target thread is blocked and not running. 398 * Then, it executes the same actions as described above. 393 * this function simply set the BLOCKED_ GLOBAL bit and the REQ_DELETE flag 394 * in the target thread descriptor and return. 395 * - When the killer thread is running on a different core than the target thread, 396 * the killer set the BLOCKED_GLOBAL bit and the REQ_ACK flag in target thread, 397 * to ask the scheduler to confirm that the target is blocked and not running. 398 * Then, it set the REQ_DELETE flag in the target thread and return. 399 * In both cases, the actual target thread destruction is done by the scheduler 400 * at the next scheduling point. 399 401 *************************************************************************************** 400 402 * @ thread : local pointer on the target thread.
Note: See TracChangeset
for help on using the changeset viewer.