TAO_Leader_Follower Class ReferenceTAO_Leader_Follower. More...
Collaboration diagram for TAO_Leader_Follower:
Detailed DescriptionTAO_Leader_Follower.Member Typedef Documentation
Implement the Leader/Followers set using an intrusive list.
Constructor & Destructor Documentation
Constructor.
Destructor.
Member Function Documentation
The current thread has become a server thread (i.e. called ORB::run), update any flags and counters.
The current thread is not a server thread anymore, reset any flags and counters.
This thread is going to perform an upcall, it will no longer be an event loop thread.
Is there any thread running as a leader?
A server thread is making a request.
A server thread has finished is making a request.
Wait on the Leader/Followers loop until one event happens.
There should be no reason to reset the value of result here. If there was an error in handle_events () that the leader saw, I (Bala) beleave it should be propogated to the clients. result = 0;
The current thread has become the leader thread in the client side leader-follower set.
The current thread is no longer the leader thread in the client side leader-follower set.
sets the thread ID of the leader thread in the leader-follower model
checks if we are a leader thread
A leader thread is relinquishing its role, unless there are more leader threads running pick up a follower (if there is any) to play the leader role.
Allocate a new follower to the caller.
The caller has finished using a follower.
Add a new follower to the set.
Removes a follower from the leader-follower set.
Checks if there are any followers available.
Get a reference to the underlying mutex.
Provide a pre-initialized reverse lock for the Leader/Followers set. The Leader/Followers set mutex must be release during some long running operations. This helper class simplifies the process of releasing and reacquiring said mutex.
Check if there are any client threads running.
Accesor to the reactor.
Called when we are out of leaders.
Shortcut to obtain the TSS resources of the orb core.
Wait for the client leader to complete.
Implement the reset_event_loop_thread() method, once the TSS resources have been acquired. Also used in the set_upcall_thread.
Remote a follower from the Followers set and promote it to the leader role. This is a helper routine for elect_new_leader(), after verifying that all the pre-conditions are satisfied the Follower set is changed and the promoted Follower is signaled.
Member Data Documentation
The orb core.
To synchronize access to the members.
Do protect the access to the following three members.
Use a free list to allocate and release Follower objects.
Count the number of active leaders. There could be many leaders in the thread pool (i.e. calling ORB::run), and the same leader could show up multiple times as it receives nested upcalls and sends more requests.
Count the number of active clients, this is useful to know when to deactivate the reactor
The reactor.
Is a client thread the current leader?
Are server threads waiting for the client leader to complete?
Condition variable for server threads waiting for the client leader to complete. Leader/Follower class uses this method to notify the system that we are out of leaders.
The documentation for this class was generated from the following files: Generated on Mon Sep 15 07:40:49 2008 for TAO by 1.5.5 |