CsSignal  1.3.1
Fundamentals

What is CsSignal

The signal / slot functionality in the CopperSpice CsCore library was moved to a standalone library called CsSignal. CopperSpice uses the CsSignal library for all signal delivery. The CopperSpice API for signals and slots was not altered.

Why CsSignal was Created

By isolating the signal / slot mechanism into a standalone library the implementation of QObject in CopperSpice was drastically simplified. QObject is the main base class and it is used by almost every component in CopperSpice.

The QObject class contained too much functionality, had too many data members, several data members were not thread safe. The signal and slot structures in QObject contained redundant data members. During the integration of CsSignal with CopperSpice these issues addressed and improved. The destructor for QObject was also enhanced and several potential race conditions were corrected.

QObject in CopperSpice has fewer members and smaller structures which leads to improvements in maintainability and readability.

Benefits of the CsSignal Library

The CsSignal library does not require or depend on any of the CopperSpice libraries. The license is BSD 2 Clause. Any C++ developer can directly link CsSignal into their application, even if you have no GUI.

One of the major benefits of CsSignal is how the library delivers signals in a multithreaded application. Signals can be delivered using a queued connection or a blocking queued connection.

In a library like Boost Signals 2, each signal is a separate object. In the CsSignal library signals and slots are both methods.

Boost Signals 2 is thread safe but a signal activation can not cross threads. In CsSignal, a signal in one thread can call a slot in another thread. We refer to this as being "thread aware".