multithreaded webserver
TRANSCRIPT
Tracy Steven Brown
C-Based Multithreaded Webserver & Learning Management System (LMS)
Software Development: C and Java
The development of a C-based multithreaded webserver with native MySQL
database support was a multi-year project supporting a massively parallel
globally deployable 100% SCORM 1.2 compliant learning management
system (LMS) delivering standards-based learning materials to metallurgical
plant operators in remote areas of the world. SCORM is a specification of
the Advanced Distributed Learning (ADL) Initiative from the Office of the
United States Secretary of Defense. The software solution was written
entirely by Tracy Steven Brown while employed at Performance Associates
International (PAI), Inc. The source code is several hundred thousand lines
and highly complex; the screen shots provided here only show an
exceedingly small fraction of the project and serve to highlight Tracy’s C
programming style. Both C development and Java development were
performed on Oracle/Sun Solaris-10 UNIX using the NetBeans IDE.
The Webserver and server-side LMS logic was written in C and the web-
based front-end was developed in XHTML and Adobe Flash via the Adobe
Flex development framework. LMS specific communication was performed asynchronously via a custom Java applet
delivering SCORM compliant callback requests to the server. The server-side component supported both XML and JSON
formatted requests and was capable of sending XHTML, XML, and JSON structured responses. MySQL was embedded into
the webserver allowing native support for integrating structured storage – this was an architectural decision to allow tier-
1 support for database caching. Subsequent database layer logic was supported for non-cached data using standard
external API hooks.
The image above highlights the software engineering patterns used within the project. One of the more salient objectives
for Tracy was abstracting logic written in C into reusable patterns
common to C++ software architects. While inheritance and
encapsulation styled patterns could not be directly
implemented, several other patterns did lend themselves to
abstraction. Note that the AVL tree pattern in the example was
adapted from the Open Solaris Kernel.
The image to the left shows the initial code for creating a UNIX
daemon – equivalent to a Windows Service. The next source
code image follows up with UNIX TCP socket configuration for
listening and responding to TCP socket communication. The
source code displayed is a small subset of the full daemon and
socket configuration base; however, it does showcase Tracy’s C
programming style. Note that there are extensive preprocessing
statements used throughout the project for tracking the code
execution stack. Other preprocessing statements include return
value error condition checking; for example, ec_cmp() is a
preprocessing comparison statement for checking return values.