Cliser: The C++ ServiceThread Class |
The Cliser POSIX-threaded Server contains a PoolManager. The PoolManager keeps track of a pool of ServiceThread objects, which are subclassed from PosixThread (see below) and CommunicatorUser.
The ServiceThread class provides the start() function to execute the run() function in a seperate thread. The run() function defaults to calling interactWithClient(), which is implemented in a subclass.
The run() method thus leaves definition of the interactWithClient() up to each subclass. The code generator generates a stub for this method, so that completing the definition of interactWithClient() is about all that must be done to complete a Cliser-generated C++ concurrent (POSIX threaded) server.
The PosixThread (and thus ServiceThread) class provides these operations:
When a POSIX Threaded server accepts a new connection, it gets a non-busy thread from the PoolManager. If all the threads are busy, the PoolManager creats a new thread. Next, the thread is assigned a (copy of) the communicator, and is given the start() message. This starts the run() function, which in turn, calls the interactWithClient() function.
Up to the Cliser class libraries | Up to the CommunicatorUser class hierarchy | Back to the Client hierarchy | Back to the Server hierarchy | Up to the Cliser source code generators |