libbsl (Basic System Library) is a powerful, easy to use and fully thread safe C++ template class library for frequently recurring (machine/OS oriented) programming problems. All fundamental objects in libbsl are freely copyable and shareable between an arbitrary number of threads - e.g. reading from a shared io device from several concurrent threads is implicitly thread safe for the programmer without additional cost and knowledge.

An important goal in developing libbsl was to keep it simple and to enable even the inexperienced programmer to quickly write complex programs with the help of libbsl. This goal is achieved by hiding most of the templates - and there are many - from the api by several reasonable typedefs.

On the other hand the generic template architecture of libbsl allows the more adept user to enhance (e.g. by the use of policy templates) or by combining libbsl's classes to create new objects or user defined functionality.


libbsl is divided into 13 main topics - namely:

  • crypto
  • datetime
  • dso
  • io
  • io/net
  • ipc
  • log
  • mime
  • options
  • thread
  • types
  • util
  • values
cryptographic classes (AES, ElGamal etc.) mainly for secure
network communication
date, time and timer classes
dynamic loadable C++ objects which remain dynamic_castable
after loading
file, directory, character devices etc. classes.
tcp/udp ipv4 (secure) socket classes etc.
program execution class, lightweight process class which enables you
to design your own fine grained program logic by the use of freely
configurable suspend an resume functions per process
error handling and logging mechanisms via syslog, files etc.
mime type detection using ternary search trees
command line options and environment setting classes
easy to use thread class, mutexes, barriers, transfer of program tasks
to threads by the use of thread functors etc.
type traits, type lists etc.
memory management, factories, daemon class, functors, "switchless"
intelligent state machine implementation, utf8 string class and much more
parameter (pair of arbitrary values as text), tuple, variant etc.
It is tested and runs on Linux (i386/x86_64), NetBSD 1.6 (i386/SPARC), Sun Solaris 5.9. It should also compile and run on any other unix on which g++ 3.0 or above is installed and pthread support is enabled.


libbsl is distributed in source and binary versions. Binary versions for

are available. They are divided into four subpackages: If you plan to develop software using libbsl's classes it is recommended to install all of the above mentioned packages or to get the source distribution, which includes a basic doxygen documentation. The documentation is far from complete right now, but will be enhanced in the near future. If you want to get an impression of how to use libbsl's classes, have a look at the demo programs.


libbsl is designed and written by Jan Uschok. Some parts - especially the functor and typelist classes - are inspired by Andrei Alexandrescu (Modern C++ Design, Addison Wesley, 2001).


Binary distribution files and source tarballs of libbsl can be found here.
Please have a look at my other project iFactory which is based on libbsl. logo