NAME

ACE_Thread_Strategy - Defines the interface for specifying a concurrency strategy for a SVC_HANDLER based on multithreading.

SYNOPSIS

#include <ace/ACE_Strategies_T.h>

template<class SVC_HANDLER> class ACE_Thread_Strategy : public ACE_Concurrency_Strategy<SVC_HANDLER> { public: ACE_Thread_Strategy (int flags = 0); ACE_Thread_Strategy ( ACE_Thread_Manager *tm, long thr_flags, size_t n_threads = 1, int flags = 0 ); virtual int open ( ACE_Thread_Manager *tm, long thr_flags, size_t n_threads = 1, int flags = 0 ); virtual ~ACE_Thread_Strategy (void); virtual int activate_svc_handler ( SVC_HANDLER *svc_handler, void *arg = 0 ); void dump (void) const; ACE_ALLOC_HOOK_DECLARE; protected: typedef ACE_Concurrency_Strategy<SVC_HANDLER> inherited; ACE_Thread_Manager *thr_mgr_; long thr_flags_; size_t n_threads_; };

DESCRIPTION

This class provides a strategy that manages the creation of threads to handle requests from clients concurrently. It behaves as a "thread factory", spawning threads "on-demand" to run the service specified by a user-supplied SVC_HANDLER.

Intialization and termination methods.

ACE_Thread_Strategy (int flags = 0);

ACE_Thread_Strategy (
    ACE_Thread_Manager *tm,
    long thr_flags,
    size_t n_threads = 1,
    int flags = 0
    );

virtual int open (
    ACE_Thread_Manager *tm,
    long thr_flags,
    size_t n_threads = 1,
    int flags = 0
    );

virtual ~ACE_Thread_Strategy (void);

Factory method.

virtual int activate_svc_handler (
    SVC_HANDLER *svc_handler,
    void *arg = 0
    );

void dump (void) const;

ACE_ALLOC_HOOK_DECLARE;

AUTHOR

Doug Schmidt

LIBRARY

ace