Threads

The ArchiveEngine uses two threads:

  1. Main thread.
  2. Write thread.
On most OSs you will see a single process. On Linux, however, one can see three "processes" like this:

This snapshot taken with ktop shows the parent/child relation. When trying a test program with two threads, one can see four "processes":

This seems to be a feature of Linux: Threads show up a processes. As far as I understand for now this is no error in the Archive Engine.

Priorities, Scheduling

The Engine code uses a simple system-independend threading wrapper class to make it compile on Win32, Linux, solaris, ... On systems other than Win32, Posix threads are used. Maybe some day the OS-independent thread wrapper from a new EPICS base release can be used instead.

To make it most portable, no thread priorities are adjusted and no scheduling mechanisms are required, because even the most basic "Posix" calls turned out to be different on HPUX.

If it should become obvious that performance dramatically improves by utilizing these options, more implementation effort will have to be put into this.

Signals

The engine tries to catch the Ctrl-C and Unix 'kill' signals.
On Win32, this seems to work correctly.
On Unix there have been problems originally. Now that the write thread blocks the signals, archive writing should be unaffected and the engine quits as soon as possible.
The preferred method for stopping the engine, though, should still be the web interface.
ChannelArchiver Manual