Server Threads Model
ClearBox Server is a multithreaded application; its threads perform different
tasks.
- Thread used to control ClearBox Server service. It is created by system
only when server runs as a service. It doesn't affect server extension
activity.
- Main application thread, referred as MAIN in this document.
At server startup all initialization takes place in this thread. When
server has read its parameters from registry, created and initialized
server extension object and RADIUS dictionary object (if RADIUS is started),
RADIUS and/or TACACS+ manager threads are created, and MAIN thread
is blocked until application termination.
- RADIUS manager thread (referred as RAD). It is created when
RADIUS is started. This thread performs a loop, receiving UDP datagrams
from sockets, reading packets from network buffer, writing packets to
network buffer and sending socket data. It's terminated on request of
MAIN thread when server stops.
- TACACS+ manager thread (referred as TAC). It is created when
TACACS+ is started. This thread performs a loop, accepting client TCP
connections, reading data from sockets, reading packets from buffer
and writing them to buffer, sending data back to TCP clients. It's terminated
on request of MAIN thread when server stops.
- RADIUS proxy manager thread (referred as PROX). It is created
when RADIUS proxy manager is started and RADIUS packet forwarding is
enabled. This thread receives tasks for packet forwarding from WORK
thread, sends/receives packets from remote hosts and returns them to
RAD thread.
- Pool of threads that perform main processing of TACACS+/RADIUS packets.
They are referred as WORK. These threads stay blocked until they
receive task to process a packet. After a packet is processed, it is
returned to TAC/RAD thread, and WORK thread is blocked
again. Note that several WORK threads may exist, depending on
server configuration. All calls to server extension methods for one
packet processing are executed in context of one WORK thread.
- Schedule agent thread (referred as SCHEDULE). It's started
from MAIN thread at startup and performs periodic scheduled tasks.
- Synchronization agent thread (referred as SYNC). It's started
from MAIN thread at startup and performs synchronization of extension's
users database with actual users list on a NAS.
- Monitoring agent thread (referred as MONITOR). It's started
from MAIN thread at startup and is responsible for communications
with Server Manager.
Server extension is a free-threaded COM-server, so no call synchronization
is performed by COM. Server extension must protect resources shared between
several threads as extension's methods are called from almost all the threads
listed above. Extension may use critical sections as a lightweight mechanism
for this purpose.
© 2001-2003 XPerience Technologies. www.xperiencetech.com
|