Changeset eaf269d


Ignore:
Timestamp:
Jan 6, 2022, 10:53:39 PM (3 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, ast-experimental, enum, forall-pointer-decay, master, pthread-emulation, qualifiedEnum
Children:
6fafda8
Parents:
6111f1f
Message:

add enum DEFAULT_STACK_SIZE in invoke.h and replace 65000 with enum, change pthread_create to use DEFAULT_STACK_SIZE

Location:
libcfa/src/concurrency
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/coroutine.hfa

    r6111f1f reaf269d  
    1010// Created On       : Mon Nov 28 12:27:26 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Feb  4 12:29:26 2020
    13 // Update Count     : 11
     12// Last Modified On : Thu Jan  6 16:33:16 2022
     13// Update Count     : 12
    1414//
    1515
     
    155155
    156156        if( unlikely(dst->context.SP == 0p) ) {
    157                 __stack_prepare(&dst->stack, 65000);
     157                __stack_prepare(&dst->stack, DEFAULT_STACK_SIZE);
    158158                __cfactx_start(main, dst, cor, __cfactx_invoke_coroutine);
    159159        }
  • libcfa/src/concurrency/invoke.h

    r6111f1f reaf269d  
    1010// Created On       : Tue Jan 17 12:27:26 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Dec  5 16:26:03 2019
    13 // Update Count     : 44
     12// Last Modified On : Thu Jan  6 16:37:40 2022
     13// Update Count     : 47
    1414//
    1515
     
    2727#ifndef _INVOKE_H_
    2828#define _INVOKE_H_
     29
     30        enum { DEFAULT_STACK_SIZE = 65000 };
    2931
    3032        struct __cfaehm_try_resume_node;
  • libcfa/src/concurrency/kernel/startup.cfa

    r6111f1f reaf269d  
    403403
    404404        __cfaabi_tls.this_thread->curr_cor = dst;
    405         __stack_prepare( &dst->stack, 65000 );
     405        __stack_prepare( &dst->stack, DEFAULT_STACK_SIZE );
    406406        __cfactx_start(main, dst, this->runner, __cfactx_invoke_coroutine);
    407407
     
    721721        check( pthread_attr_init( &attr ), "pthread_attr_init" ); // initialize attribute
    722722
    723         size_t stacksize;
    724         // default stack size, normally defined by shell limit
    725         check( pthread_attr_getstacksize( &attr, &stacksize ), "pthread_attr_getstacksize" );
    726         assert( stacksize >= PTHREAD_STACK_MIN );
     723        size_t stacksize = DEFAULT_STACK_SIZE;
    727724
    728725        void * stack;
     
    749746        #endif
    750747
    751 
    752748        check( pthread_attr_setstack( &attr, stack, stacksize ), "pthread_attr_setstack" );
    753 
    754749        check( pthread_create( pthread, &attr, start, arg ), "pthread_create" );
    755750        return stack;
  • libcfa/src/concurrency/thread.hfa

    r6111f1f reaf269d  
    1010// Created On       : Tue Jan 17 12:27:26 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Dec  4 09:18:14 2019
    13 // Update Count     : 6
     12// Last Modified On : Thu Jan  6 16:40:16 2022
     13// Update Count     : 7
    1414//
    1515
     
    6565void ^?{}(thread$ & this);
    6666
    67 static inline void ?{}(thread$ & this)                                                                  { this{ "Anonymous Thread", *mainCluster, 0p, 65000 }; }
     67static inline void ?{}(thread$ & this)                                                                  { this{ "Anonymous Thread", *mainCluster, 0p, DEFAULT_STACK_SIZE }; }
    6868static inline void ?{}(thread$ & this, size_t stackSize )                                               { this{ "Anonymous Thread", *mainCluster, 0p, stackSize }; }
    6969static inline void ?{}(thread$ & this, void * storage, size_t storageSize )                             { this{ "Anonymous Thread", *mainCluster, storage, storageSize }; }
    70 static inline void ?{}(thread$ & this, struct cluster & cl )                                            { this{ "Anonymous Thread", cl, 0p, 65000 }; }
     70static inline void ?{}(thread$ & this, struct cluster & cl )                                            { this{ "Anonymous Thread", cl, 0p, DEFAULT_STACK_SIZE }; }
    7171static inline void ?{}(thread$ & this, struct cluster & cl, size_t stackSize )                          { this{ "Anonymous Thread", cl, 0p, stackSize }; }
    7272static inline void ?{}(thread$ & this, struct cluster & cl, void * storage, size_t storageSize )        { this{ "Anonymous Thread", cl, storage, storageSize }; }
    73 static inline void ?{}(thread$ & this, const char * const name)                                         { this{ name, *mainCluster, 0p, 65000 }; }
    74 static inline void ?{}(thread$ & this, const char * const name, struct cluster & cl )                   { this{ name, cl, 0p, 65000 }; }
     73static inline void ?{}(thread$ & this, const char * const name)                                         { this{ name, *mainCluster, 0p, DEFAULT_STACK_SIZE }; }
     74static inline void ?{}(thread$ & this, const char * const name, struct cluster & cl )                   { this{ name, cl, 0p, DEFAULT_STACK_SIZE }; }
    7575static inline void ?{}(thread$ & this, const char * const name, struct cluster & cl, size_t stackSize ) { this{ name, cl, 0p, stackSize }; }
    7676
Note: See TracChangeset for help on using the changeset viewer.