- File:
-
- 1 edited
-
libcfa/src/concurrency/kernel/startup.cfa (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/kernel/startup.cfa
r431cd4f ra5a01faa 268 268 __print_stats( st, mainProcessor->print_stats, "Processor ", mainProcessor->name, (void*)mainProcessor ); 269 269 } 270 #if defined(CFA_STATS_ARRAY)271 __flush_stat( st, "Processor", mainProcessor );272 #endif273 270 #endif 274 271 … … 351 348 __print_stats( &local_stats, proc->print_stats, "Processor ", proc->name, (void*)proc ); 352 349 } 353 #if defined(CFA_STATS_ARRAY)354 __flush_stat( &local_stats, "Processor", proc );355 #endif356 350 #endif 357 351 … … 469 463 this.name = name; 470 464 this.cltr = &_cltr; 471 this.rdq.its = 0;472 this.rdq.itr = 0;473 this.rdq.id = -1u;474 this.rdq.target = -1u;475 this.rdq.cutoff = -1ull;476 465 do_terminate = false; 477 466 preemption_alarm = 0p; … … 494 483 #endif 495 484 496 // Register and Lock the RWlock so no-one pushes/pops while we are changing the queue 497 uint_fast32_t last_size = ready_mutate_register((__processor_id_t*)&this); 498 this.cltr->procs.total += 1u; 499 insert_last(this.cltr->procs.actives, this); 485 lock( this.cltr->idles ); 486 int target = this.cltr->idles.total += 1u; 487 unlock( this.cltr->idles ); 488 489 id = doregister((__processor_id_t*)&this); 490 491 // Lock the RWlock so no-one pushes/pops while we are changing the queue 492 uint_fast32_t last_size = ready_mutate_lock(); 500 493 501 494 // Adjust the ready queue size 502 ready_queue_grow( cltr);495 this.cltr_id = ready_queue_grow( cltr, target ); 503 496 504 497 // Unlock the RWlock … … 510 503 // Not a ctor, it just preps the destruction but should not destroy members 511 504 static void deinit(processor & this) { 505 lock( this.cltr->idles ); 506 int target = this.cltr->idles.total -= 1u; 507 unlock( this.cltr->idles ); 508 512 509 // Lock the RWlock so no-one pushes/pops while we are changing the queue 513 510 uint_fast32_t last_size = ready_mutate_lock(); 514 this.cltr->procs.total -= 1u;515 remove(this);516 511 517 512 // Adjust the ready queue size 518 ready_queue_shrink( this.cltr ); 519 520 // Unlock the RWlock and unregister: we don't need the read_lock any more 521 ready_mutate_unregister((__processor_id_t*)&this, last_size ); 513 ready_queue_shrink( this.cltr, target ); 514 515 // Unlock the RWlock 516 ready_mutate_unlock( last_size ); 517 518 // Finally we don't need the read_lock any more 519 unregister((__processor_id_t*)&this); 522 520 523 521 close(this.idle); … … 562 560 //----------------------------------------------------------------------------- 563 561 // Cluster 564 static void ?{}(__cluster_ proc_list& this) {562 static void ?{}(__cluster_idles & this) { 565 563 this.lock = 0; 566 564 this.idle = 0; 567 565 this.total = 0; 566 (this.list){}; 568 567 } 569 568 … … 591 590 592 591 // Adjust the ready queue size 593 ready_queue_grow( &this );592 ready_queue_grow( &this, 0 ); 594 593 595 594 // Unlock the RWlock … … 606 605 607 606 // Adjust the ready queue size 608 ready_queue_shrink( &this );607 ready_queue_shrink( &this, 0 ); 609 608 610 609 // Unlock the RWlock … … 616 615 __print_stats( this.stats, this.print_stats, "Cluster", this.name, (void*)&this ); 617 616 } 618 #if defined(CFA_STATS_ARRAY)619 __flush_stat( this.stats, "Cluster", &this );620 #endif621 617 free( this.stats ); 622 618 #endif
Note:
See TracChangeset
for help on using the changeset viewer.