Skip to content
Rich Neswold edited this page Mar 30, 2022 · 4 revisions

VxWorks Concurrency Library

vwpp is a C++ library that wraps the low-level VxWorks IPC primitives into a more useful and safe form. This library relieves the programmer from keeping track of resource management details, instead letting the compiler handle them. This library meets the strong exception guarantee[^1] and is exception-safe.

To use the library, your source code needs to include vwpp.h. No references from the VxWorks' headers are used, so if this library meets your needs, you don't have to include any VxWorks headers. Your startup script needs to load vwpp.out from the proper BSP and version directory before any module that uses the library is loaded (or, you can link with the static library so nothing has to be pre-loaded.)

The library encapsulates the following primitives:

There are also experimental APIs:

All functions and types are defined in the vwpp namespace.

Usage

The stable library is at version 2.6 and has been built for VxWorks versions 6.4 and 6.7. You may load the VxWorks module by adding the following to your startup script:

ld(1, 1, "vxworks_boot/v#.#/module/BSP/vwpp-2.6.out");

where v#.# is your version of VxWorks (i.e. v6.4, or v6.7). BSP should be replaced by your board support package designation (e.g. mv2401). The library is fairly small and contains many simple, one-line functions so this author typically links his modules with the static library, which removes the necessity of loading the module. Adding ${PRODUCTS_LIBDIR}/libvwpp-2.6.a to the dependency list of the .out target will create a module that doesn't require preloading the vwpp module.

The 6.x C++ compilers report a compile-time error when embedding objects in structures (or other objects) while using the -fpack-struct option. The front-end group has removed the requirement of -fpack-struct in MOOC and ACNET, so this shouldn't be a problem unless your Makefile adds this option to your project's build.

NOTE: Many routines in this library specify a time-out parameter given in units of milliseconds. Since the underlying VxWorks primitives use system ticks for their timeout, the actual time delay will be rounded to the next higher tick value.

Tutorials

Here are some pages that describe the design of the library along with examples of how to use it.

Changes in v2.7

v2.7 is available for testing out new features. It is not recommended for use in operational systems since any interfaces not in v2.6 are subject to change before the release. However, I appreciate any feedback, so if you want to try new features, install this on a development machine.

  • Added a nested namespace, v2_7, so that identifiers that are name-mangled will include the version. Code compiled with header files from one version but loading a different version will get undefined symbol errors. With each release, the nested namespace will get updated.

[^1]: The strong guarantee is that, if the function fails due to an exception, the program state must not be changed.

Clone this wiki locally