NAME
ACE_Process_Strategy -
Defines the interface for specifying a concurrency strategy
for a SVC_HANDLER based on multiprocessing.
SYNOPSIS
#include <ace/ACE_Strategies.h >
template<class SVC_HANDLER>
class ACE_Process_Strategy :
public ACE_Concurrency_Strategy<SVC_HANDLER>
{
public:
ACE_Process_Strategy (void);
ACE_Process_Strategy (int n_processes = 1);
virtual int open (int n_processes = 1);
~ACE_Process_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;
int n_processes_;
};
DESCRIPTION
This class provides a strategy that manages the creation of
processes to handle requests from clients concurrently. It
behaves as a "process factory", forking threads "on-demand"
to run the service specified by a user-supplied
SVC_HANDLER.
Intialization and termination methods.
ACE_Process_Strategy (void);
ACE_Process_Strategy (int n_processes = 1);
virtual int open (int n_processes = 1);
~ACE_Process_Strategy (void);
Factory method.
virtual int activate_svc_handler (
SVC_HANDLER *svc_handler,
void *arg = 0
);
Activate the svc_handler with an appropriate concurrency
strategy. This method activates the SVC_HANDLER by first forking
and then calling the open() method of the SVC_HANDLER in the
child.
void dump (void) const;
Dump the state of an object.
ACE_ALLOC_HOOK_DECLARE;
Declare the dynamic allocation hooks.
AUTHOR
Doug Schmidt
LIBRARY
ace