Changeset e39cfb9
- Timestamp:
- Jun 19, 2023, 1:55:23 PM (17 months ago)
- Branches:
- master
- Children:
- 0388a99
- Parents:
- ca0c311
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/actor.hfa
rca0c311 re39cfb9 53 53 message * msg; 54 54 __receive_fn fn; 55 // bool stop; // commented from change to termination flag from sentinels C_TODO: remove after confirming no performance degradation56 55 }; 57 56 … … 59 58 int m; 60 59 }; 61 static inline void ?{}( request & this ) { 62 // this.stop = true; // default ctor makes a sentinel 63 } 60 static inline void ?{}( request & this ) {} 64 61 static inline void ?{}( request & this, actor * base_receiver, actor * receiver, message * base_msg, message * msg, __receive_fn fn ) { 65 62 this.base_receiver = base_receiver; … … 68 65 this.msg = msg; 69 66 this.fn = fn; 70 // this.stop = false;71 67 } 72 68 static inline void ?{}( request & this, request & copy ) { … … 74 70 this.msg = copy.msg; 75 71 this.fn = copy.fn; 76 // this.stop = copy.stop;77 72 } 78 73 … … 97 92 } 98 93 99 static inline void insert( copy_queue & this, request & elem ) with(this) { // C_TODO: remove redundant send/insert once decision is made on emplace/copy94 static inline void insert( copy_queue & this, request & elem ) with(this) { 100 95 if ( count >= buffer_size ) { // increase arr size 101 96 last_size = buffer_size; … … 338 333 339 334 static inline void ^?{}( executor & this ) with(this) { 340 // #ifdef __STEAL // commented from change to termination flag from sentinels C_TODO: remove after confirming no performance degradation341 // request sentinels[nrqueues];342 // for ( unsigned int i = 0; i < nrqueues; i++ ) {343 // insert( request_queues[i], sentinels[i] ); // force eventually termination344 // } // for345 // #else346 // request sentinels[nworkers];347 // unsigned int reqPerWorker = nrqueues / nworkers, extras = nrqueues % nworkers;348 // for ( unsigned int i = 0, step = 0, range; i < nworkers; i += 1, step += range ) {349 // range = reqPerWorker + ( i < extras ? 1 : 0 );350 // insert( request_queues[step], sentinels[i] ); // force eventually termination351 // } // for352 // #endif353 335 is_shutdown = true; 354 336 … … 614 596 #ifdef __STEAL 615 597 if ( is_empty( *current_queue ) ) { 616 if ( unlikely( no_steal ) ) { CHECK_TERMINATION; continue; } // C_TODO: if this impacts static/dynamic perf refactor check598 if ( unlikely( no_steal ) ) { CHECK_TERMINATION; continue; } 617 599 empty_count++; 618 600 if ( empty_count < steal_threshold ) continue; … … 637 619 &req = &remove( *current_queue ); 638 620 if ( !&req ) continue; 639 // if ( req.stop ) break Exit;640 621 deliver_request( req ); 641 622 } … … 679 660 } 680 661 681 // TODO: potentially revisit getting number of processors 682 // ( currently the value stored in active_cluster()->procs.total is often stale 683 // and doesn't reflect how many procs are allocated ) 684 // static inline void start_actor_system() { start_actor_system( active_cluster()->procs.total ); } 685 static inline void start_actor_system() { start_actor_system( 1 ); } 662 static inline void start_actor_system() { start_actor_system( get_proc_count( *active_cluster() ) ); } 686 663 687 664 static inline void start_actor_system( executor & this ) { … … 693 670 694 671 static inline void stop_actor_system() { 695 park( ); // will receive signalwhen actor system is finished672 park( ); // will be unparked when actor system is finished 696 673 697 674 if ( !__actor_executor_passed ) delete( __actor_executor_ );
Note: See TracChangeset
for help on using the changeset viewer.