Ignore:
Timestamp:
Jul 18, 2019, 2:06:55 PM (5 years ago)
Author:
alain
Message:

Introduce the non-standard pthread_parallel_create() system call
and re-write the <fft> and <sort> applications to improve the
intrinsic paralelism in applications.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/syscalls/sys_thread_create.c

    r635 r637  
    6666
    6767#if DEBUG_SYS_THREAD_CREATE
    68 tm_start = hal_get_cycles();
    6968if( DEBUG_SYS_THREAD_CREATE < tm_start )
    7069printk("\n[%s] thread[%x,%x] enter / cycle %d\n",
     
    7372
    7473    // check trdid buffer in user space
    75     error = vmm_get_vseg( process , (intptr_t)trdid_ptr , &vseg );
    76 
    77     if ( error )
     74    if( vmm_get_vseg( process , (intptr_t)trdid_ptr , &vseg ) )
    7875    {
    7976
     
    8986    if( user_attr != NULL )
    9087    {
    91             error = vmm_get_vseg( process , (intptr_t)user_attr , &vseg );
    92 
    93             if( error )
     88            if( vmm_get_vseg( process , (intptr_t)user_attr , &vseg ) )
    9489            {
    9590
     
    10297            }
    10398       
    104             hal_copy_from_uspace( local_cxy,
    105                               &kern_attr,
     99            hal_copy_from_uspace( XPTR( local_cxy , &kern_attr ),
    106100                              user_attr,
    107101                              sizeof(pthread_attr_t) );
     
    109103
    110104        // check start_func in user space
    111         error = vmm_get_vseg( process , (intptr_t)start_func , &vseg );
    112 
    113     if( error )
     105        if( vmm_get_vseg( process , (intptr_t)start_func , &vseg ) )
    114106    {
    115107
     
    125117        if( start_args != NULL )
    126118    {
    127         error = vmm_get_vseg( process , (intptr_t)start_args , &vseg );
    128 
    129             if( error )
     119        if( vmm_get_vseg( process , (intptr_t)start_args , &vseg ) )
    130120            {
    131121
     
    145135            if( kern_attr.attributes & PT_ATTR_CLUSTER_DEFINED )
    146136            {
    147                     if( cluster_is_undefined( kern_attr.cxy ) )
     137                    if( cluster_is_active( kern_attr.cxy ) == false )
    148138                    {
    149139
     
    159149        else
    160150        {
    161             child_cxy = dqdt_get_cluster_for_process();
     151            child_cxy = dqdt_get_cluster_for_thread( LOCAL_CLUSTER->dqdt_root_xp );
    162152        }
    163153        }
     
    165155        {
    166156        kern_attr.attributes = PT_ATTR_DETACH | PT_ATTR_CLUSTER_DEFINED;
    167         child_cxy           = dqdt_get_cluster_for_process();
     157        child_cxy = dqdt_get_cluster_for_thread( LOCAL_CLUSTER->dqdt_root_xp );
    168158        }
    169159
     
    209199        // returns trdid to user space
    210200        trdid = hal_remote_l32( XPTR( child_cxy , &child_ptr->trdid ) );
    211         hal_copy_to_uspace( local_cxy,
    212                         &trdid,
    213                         trdid_ptr,
     201        hal_copy_to_uspace( trdid_ptr,
     202                        XPTR( local_cxy , &trdid ),
    214203                        sizeof(pthread_t) );
    215204
Note: See TracChangeset for help on using the changeset viewer.