#include <Thread_Pool.h>
Collaboration diagram for TAO_Thread_Pool:
Accessors | |
TAO_Thread_Pool_Manager & | manager (void) const |
CORBA::ULong | id (void) const |
CORBA::ULong | stack_size (void) const |
CORBA::Boolean | allow_borrowing (void) const |
CORBA::Boolean | allow_request_buffering (void) const |
CORBA::ULong | max_buffered_requests (void) const |
CORBA::ULong | max_request_buffer_size (void) const |
TAO_Thread_Lane ** | lanes (void) |
CORBA::ULong | number_of_lanes (void) const |
Public Member Functions | |
TAO_Thread_Pool (TAO_Thread_Pool_Manager &manager, CORBA::ULong id, CORBA::ULong stack_size, CORBA::ULong static_threads, CORBA::ULong dynamic_threads, CORBA::Short default_priority, CORBA::Boolean allow_request_buffering, CORBA::ULong max_buffered_requests, CORBA::ULong max_request_buffer_size, ACE_Time_Value const &dynamic_thread_idle_timeout) | |
Constructor (for pools without lanes). | |
TAO_Thread_Pool (TAO_Thread_Pool_Manager &manager, CORBA::ULong id, CORBA::ULong stack_size, const RTCORBA::ThreadpoolLanes &lanes, CORBA::Boolean allow_borrowing, CORBA::Boolean allow_request_buffering, CORBA::ULong max_buffered_requests, CORBA::ULong max_request_buffer_size, ACE_Time_Value const &dynamic_thread_idle_timeout) | |
Constructor (for pools with lanes). | |
~TAO_Thread_Pool (void) | |
Destructor. | |
void | open (void) |
Open the pool. | |
void | finalize (void) |
Finalize the resources. | |
void | shutdown_reactor (void) |
Shutdown the reactor. | |
void | wait (void) |
Wait for threads to exit. | |
void | shutting_down (void) |
Mark this thread pool that we are shutting down. | |
int | is_collocated (const TAO_MProfile &mprofile) |
Does mprofile belong to us? | |
int | create_static_threads (void) |
Create the static threads - only called once. | |
bool | with_lanes (void) const |
Check if this thread pool has (explicit) lanes. | |
Private Attributes | |
TAO_Thread_Pool_Manager & | manager_ |
CORBA::ULong | id_ |
CORBA::ULong | stack_size_ |
CORBA::Boolean | allow_borrowing_ |
CORBA::Boolean | allow_request_buffering_ |
CORBA::ULong | max_buffered_requests_ |
CORBA::ULong | max_request_buffer_size_ |
ACE_Time_Value const | dynamic_thread_idle_timeout_ |
TAO_Thread_Lane ** | lanes_ |
CORBA::ULong | number_of_lanes_ |
bool | with_lanes_ |
Definition at line 254 of file Thread_Pool.h.
|
Constructor (for pools without lanes).
Definition at line 445 of file Thread_Pool.cpp. References ACE_NEW.
00456 : manager_ (manager), 00457 id_ (id), 00458 stack_size_ (stack_size), 00459 allow_borrowing_ (0), 00460 allow_request_buffering_ (allow_request_buffering), 00461 max_buffered_requests_ (max_buffered_requests), 00462 max_request_buffer_size_ (max_request_buffer_size), 00463 dynamic_thread_idle_timeout_ (dynamic_thread_idle_timeout), 00464 lanes_ (0), 00465 number_of_lanes_ (1), 00466 with_lanes_ (false) 00467 { 00468 // No support for buffering. 00469 if (allow_request_buffering) 00470 throw ::CORBA::NO_IMPLEMENT (); 00471 00472 // Create one lane. 00473 ACE_NEW (this->lanes_, 00474 TAO_Thread_Lane *[this->number_of_lanes_]); 00475 ACE_NEW (this->lanes_[0], 00476 TAO_Thread_Lane (*this, 00477 0, 00478 default_priority, 00479 static_threads, 00480 dynamic_threads, 00481 dynamic_thread_idle_timeout 00482 )); 00483 } |
|
Constructor (for pools with lanes).
Definition at line 485 of file Thread_Pool.cpp. References ACE_NEW, number_of_lanes_, and RTCORBA::ThreadpoolLanes.
00495 : manager_ (manager), 00496 id_ (id), 00497 stack_size_ (stack_size), 00498 allow_borrowing_ (allow_borrowing), 00499 allow_request_buffering_ (allow_request_buffering), 00500 max_buffered_requests_ (max_buffered_requests), 00501 max_request_buffer_size_ (max_request_buffer_size), 00502 dynamic_thread_idle_timeout_ (dynamic_thread_idle_timeout), 00503 lanes_ (0), 00504 number_of_lanes_ (lanes.length ()), 00505 with_lanes_ (true) 00506 { 00507 // No support for buffering or borrowing. 00508 if (allow_borrowing || 00509 allow_request_buffering) 00510 throw ::CORBA::NO_IMPLEMENT (); 00511 00512 // Create multiple lane. 00513 ACE_NEW (this->lanes_, 00514 TAO_Thread_Lane *[this->number_of_lanes_]); 00515 for (CORBA::ULong i = 0; 00516 i != this->number_of_lanes_; 00517 ++i) 00518 ACE_NEW (this->lanes_[i], 00519 TAO_Thread_Lane (*this, 00520 i, 00521 lanes[i].lane_priority, 00522 lanes[i].static_threads, 00523 lanes[i].dynamic_threads, 00524 dynamic_thread_idle_timeout 00525 )); 00526 } |
|
Destructor.
Definition at line 540 of file Thread_Pool.cpp. References lanes_, and number_of_lanes_.
00541 { 00542 // Delete all the lanes. 00543 for (CORBA::ULong i = 0; 00544 i != this->number_of_lanes_; 00545 ++i) 00546 delete this->lanes_[i]; 00547 00548 delete[] this->lanes_; 00549 } |
|
Definition at line 100 of file Thread_Pool.inl. References allow_borrowing_.
00101 { 00102 return this->allow_borrowing_; 00103 } |
|
Definition at line 107 of file Thread_Pool.inl. References allow_request_buffering_.
00108 { 00109 return this->allow_request_buffering_; 00110 } |
|
Create the static threads - only called once.
Definition at line 611 of file Thread_Pool.cpp. References TAO_Thread_Lane::create_static_threads(), lanes_, and number_of_lanes_. Referenced by TAO_Thread_Pool_Manager::create_threadpool_helper().
00612 { 00613 for (CORBA::ULong i = 0; 00614 i != this->number_of_lanes_; 00615 ++i) 00616 { 00617 // Ask each lane to create its set of static threads. 00618 int result = this->lanes_[i]->create_static_threads (); 00619 00620 // Return on failure. 00621 if (result != 0) 00622 return result; 00623 } 00624 00625 // Success. 00626 return 0; 00627 } |
|
Finalize the resources.
Definition at line 552 of file Thread_Pool.cpp. References TAO_Thread_Lane::finalize(), lanes_, and number_of_lanes_. Referenced by TAO_Thread_Pool_Manager::create_threadpool_helper(), and TAO_Thread_Pool_Manager::destroy_threadpool().
00553 { 00554 // Finalize all the lanes. 00555 for (CORBA::ULong i = 0; 00556 i != this->number_of_lanes_; 00557 ++i) 00558 this->lanes_[i]->finalize (); 00559 } |
|
Definition at line 86 of file Thread_Pool.inl.
00087 { 00088 return this->id_; 00089 } |
|
Does mprofile belong to us?
Definition at line 593 of file Thread_Pool.cpp. References TAO_Thread_Lane::is_collocated(), lanes_, and number_of_lanes_.
00594 { 00595 // Finalize all the lanes. 00596 for (CORBA::ULong i = 0; 00597 i != this->number_of_lanes_; 00598 ++i) 00599 { 00600 int result = 00601 this->lanes_[i]->is_collocated (mprofile); 00602 00603 if (result) 00604 return result; 00605 } 00606 00607 return 0; 00608 } |
|
Definition at line 128 of file Thread_Pool.inl. References lanes_.
00129 { 00130 return this->lanes_; 00131 } |
|
Definition at line 79 of file Thread_Pool.inl. References manager_. Referenced by TAO_Thread_Lane::create_threads_i(), TAO_Thread_Lane::new_dynamic_thread(), TAO_Thread_Lane::open(), TAO_Thread_Pool_Threads::svc(), and TAO_Thread_Lane::validate_and_map_priority().
00080 { 00081 return this->manager_; 00082 } |
|
Definition at line 114 of file Thread_Pool.inl. References max_buffered_requests_.
00115 { 00116 return this->max_buffered_requests_; 00117 } |
|
Definition at line 121 of file Thread_Pool.inl. References max_request_buffer_size_.
00122 { 00123 return this->max_request_buffer_size_; 00124 } |
|
Definition at line 135 of file Thread_Pool.inl. References number_of_lanes_.
00136 { 00137 return this->number_of_lanes_; 00138 } |
|
Open the pool.
Definition at line 529 of file Thread_Pool.cpp. References lanes_, number_of_lanes_, and TAO_Thread_Lane::open(). Referenced by TAO_Thread_Pool_Manager::create_threadpool_helper().
00530 { 00531 // Open all the lanes. 00532 for (CORBA::ULong i = 0; 00533 i != this->number_of_lanes_; 00534 ++i) 00535 { 00536 this->lanes_[i]->open (); 00537 } 00538 } |
|
Shutdown the reactor.
Definition at line 562 of file Thread_Pool.cpp. References lanes_, number_of_lanes_, and TAO_Thread_Lane::shutdown_reactor(). Referenced by TAO_Thread_Pool_Manager::destroy_threadpool().
00563 { 00564 // Finalize all the lanes. 00565 for (CORBA::ULong i = 0; 00566 i != this->number_of_lanes_; 00567 ++i) 00568 this->lanes_[i]->shutdown_reactor (); 00569 } |
|
Mark this thread pool that we are shutting down.
Definition at line 572 of file Thread_Pool.cpp. References lanes_, number_of_lanes_, and TAO_Thread_Lane::shutting_down(). Referenced by TAO_Thread_Pool_Manager::destroy_threadpool().
00573 { 00574 // Finalize all the lanes. 00575 for (CORBA::ULong i = 0; 00576 i != this->number_of_lanes_; 00577 ++i) 00578 this->lanes_[i]->shutting_down (); 00579 } |
|
Definition at line 93 of file Thread_Pool.inl. Referenced by TAO_Thread_Lane::create_threads_i().
00094 { 00095 return this->stack_size_; 00096 } |
|
Wait for threads to exit.
Definition at line 583 of file Thread_Pool.cpp. References lanes_, number_of_lanes_, and TAO_Thread_Lane::wait(). Referenced by TAO_Thread_Pool_Manager::destroy_threadpool().
00584 { 00585 // Finalize all the lanes. 00586 for (CORBA::ULong i = 0; 00587 i != this->number_of_lanes_; 00588 ++i) 00589 this->lanes_[i]->wait (); 00590 } |
|
Check if this thread pool has (explicit) lanes.
Definition at line 72 of file Thread_Pool.inl. References with_lanes_.
00073 { 00074 return this->with_lanes_; 00075 } |
|
Definition at line 331 of file Thread_Pool.h. Referenced by allow_borrowing(). |
|
Definition at line 332 of file Thread_Pool.h. Referenced by allow_request_buffering(). |
|
Definition at line 335 of file Thread_Pool.h. |
|
Definition at line 328 of file Thread_Pool.h. |
|
Definition at line 337 of file Thread_Pool.h. Referenced by create_static_threads(), finalize(), is_collocated(), lanes(), open(), shutdown_reactor(), shutting_down(), wait(), and ~TAO_Thread_Pool(). |
|
Definition at line 327 of file Thread_Pool.h. Referenced by manager(). |
|
Definition at line 333 of file Thread_Pool.h. Referenced by max_buffered_requests(). |
|
Definition at line 334 of file Thread_Pool.h. Referenced by max_request_buffer_size(). |
|
Definition at line 338 of file Thread_Pool.h. Referenced by create_static_threads(), finalize(), is_collocated(), number_of_lanes(), open(), shutdown_reactor(), shutting_down(), TAO_Thread_Pool(), wait(), and ~TAO_Thread_Pool(). |
|
Definition at line 330 of file Thread_Pool.h. |
|
Definition at line 339 of file Thread_Pool.h. Referenced by with_lanes(). |