Ignore:
Timestamp:
May 3, 2018, 5:51:22 PM (6 years ago)
Author:
alain
Message:

1/ Fix a bug in the Multithreaded "sort" applicationr:
The pthread_create() arguments must be declared as global variables.
2/ The exit syscall can be called by any thread of a process..

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/kern/process.h

    r436 r440  
    101101 * 4) The <sem_root>, <mutex_root>, <barrier_root>, <condvar_root>, and the associated
    102102 *    <sync_lock>, that are dynamically allocated, are only defined in the reference cluster.
    103  * 5) The <children_root>, <children_nr>, <brothers_list>, and <txt_list> fields are only
     103 * 5) The <children_root>, <children_nr>, <children_list>, and <txt_list> fields are only
    104104 *    defined in the reference cluster, and are undefined in other clusters.
    105105 * 6) The <local_list>, <copies_list>, <th_tbl>, <th_nr>, <th_lock> fields
    106106 *    are defined in all process descriptors copies.
    107107 * 7) The termination <flags> and <exit_status> are only defined in the reference cluster.
     108 *    The term state format is defined in the shared_syscalls.h file.
    108109 ********************************************************************************************/
    109110
     
    282283 * all threads of a process identified by the <pid> argument, depending on the
    283284 * <action_type> argument.
    284  * WARNING : the DELETE action is NOT executed on the target process main thread
    285  * (thread 0 in process owner cluster).
     285 * WARNING : the DELETE and BLOCK actions are NOT executed on the target process main thread
     286 * (thread 0 in process owner cluster), and not executed on the calling thread itself.
    286287 * It uses the multicast, non blocking rpc_process_sigaction_client() function to send
    287  * parallel requests to all remote clusters containing a process copy.
     288 * parallel requests to all remote clusters containing process copies.
    288289 * Then it blocks and deschedule to wait completion of these parallel requests.
    289290 *
     
    305306
    306307/*********************************************************************************************
    307  * This function blocks all threads - but the main thread - for a given <process>
    308  * in a given cluster. It sets the THREAD_BLOCKED_GLOBAL bit in the thread descriptor,
    309  * and request the relevant schedulers to acknowledge the blocking, using IPI if required.
     308 * This function blocks all threads for a given <process> in the local cluster.
     309 * It scan the list of local thread, and sets the THREAD_BLOCKED_GLOBAL bit for all
     310 * threads, BUT the main thread (thread 0 in owner cluster), and the client thread
     311 * identified by the <client_xp> argument. It request the relevant schedulers to acknowledge
     312 * the blocking, using IPI if required, and returns only when all blockable threads
     313 * in cluster are actually blocked.
    310314 * The threads are not detached from the scheduler, and not detached from the local process.
    311  * This function returns only when all blockable threads in cluster are actually blocked.
    312315 *********************************************************************************************
    313316 * @ process     : pointer on the target process descriptor.
    314  ********************************************************************************************/
    315 void process_block_threads( process_t * process );
     317 * @ client_xp   : extended pointer on the client thread that should not be blocked.
     318 ********************************************************************************************/
     319void process_block_threads( process_t * process,
     320                            xptr_t      client_xp );
     321
     322/*********************************************************************************************
     323 * This function marks for deletion all threads for a given <process> in the local cluster.
     324 * It scan the list of local thread, and sets the THREAD_FLAG_REQ_DELETE bit for all
     325 * threads, BUT the main thread (thread 0 in owner cluster), and the client thread
     326 * identified by the <client_xp> argument.
     327 * The actual deletion will be done by the scheduler at the next scheduling point.
     328 *********************************************************************************************
     329 * @ process     : pointer on the process descriptor.
     330 * @ client_xp   : extended pointer on the client thread that should not be marked.
     331 ********************************************************************************************/
     332void process_delete_threads( process_t * process,
     333                            xptr_t       client_xp );
    316334
    317335/*********************************************************************************************
     
    321339 ********************************************************************************************/
    322340void process_unblock_threads( process_t * process );
    323 
    324 /*********************************************************************************************
    325  * This function marks for deletion all threads - but the main thread - for a given <process>
    326  * in a given cluster. It sets the THREAD_FLAG_REQ_DELETE bit. For each marked thread,
    327  * the following actions will be done by the scheduler at the next scheduling point:
    328  * - the thread will be detached from the scheduler.
    329  * - the thread will be detached from the local process descriptor.
    330  * - the thread will be detached from parent if required.
    331  * - the memory allocated to the thread descriptor is released.
    332  * - the memory allocated to the process descriptor is released, if it is the last thread.
    333  *********************************************************************************************
    334  * @ process     : pointer on the process descriptor.
    335  ********************************************************************************************/
    336 void process_delete_threads( process_t * process );
    337341
    338342/*********************************************************************************************
     
    398402                            struct thread_s ** child_thread_ptr );
    399403
    400 
    401404/********************   File Management Operations   ****************************************/
    402405
Note: See TracChangeset for help on using the changeset viewer.