cp_pooled_thread_client_interface *
cp_pooled_thread_client_interface_create(
cp_pooled_thread_scheduler *owner, void *client,
int min_threads, int max_threads,
cp_pooled_thread_report_load report_load,
cp_pooled_thread_shrink shrink,
cp_thread_action action, void *action_prm,
cp_thread_stop_fn stop_fn, void *stop_prm);
void cp_pooled_thread_client_interface_destroy(
cp_pooled_thread_client_interface *client);
void cp_pooled_thread_client_get_nb(
cp_pooled_thread_client_interface *client);
void cp_pooled_thread_client_get(
cp_pooled_thread_client_interface *client);
void cp_pooled_thread_client_get_stoppable_nb(
cp_pooled_thread_client_interface *client);
void cp_pooled_thread_client_get_stoppable(
cp_pooled_thread_client_interface *client);
void cp_pooled_thread_client_negociate(
cp_pooled_thread_client_interface *client);
cp_pooled_thread_client_interface associates an action (thread function) with a cp_pooled_thread_scheduler for clients that require a variable number of threads. This interface holds 3 functions pointers that must be supplied by client code:
o report_load - should return a measure of the load for this client's action,
such as the number of open requests the client has to handle
o shrink - will be called by the framework to stop one client thread
o action - the thread function for this client
application code should call the cp_pooled_thread_client_get* functions to instantiate threads, thereby activating the load balancing framework.
cp_pooled_thread_client_negociate should be called by client code on high loads to request additional threads from the framework.
This document was created by
man2html,
using the manual pages. Time: 17:35:16 GMT, December 30, 2005 |