r6.1.0:Introduction
Data Structures
This release of liblfds provides the following;
- Freelist
- Queue
- Ringbuffer (each element read by a single reader)
- SList (logical delete only)
- Stack
These are all many-readers, many-writers.
Supported Platforms
Out-of-the-box ports are provided for;
Hardware | Operating System | Toolchain Choices |
x64 | Windows 64-bit | 1. Microsoft Visual Studio 2. Microsoft Windows SDK and GNUmake |
x64 x86 |
Windows 32-bit | 1. Microsoft Visual Studio 2. Visual C++ Express Edition 3. Microsoft Windows SDK and GNUmake |
x64 x86 |
Windows Kernel | 1. Windows Driver Kit |
x64 | Linux 64-bit | 1. GCC and GNUmake |
x64 x86 ARM |
Linux 32-bit | 1. GCC and GNUmake |
For more information including version requirements, see the building guide (lfds).
Using
Once built, there is a single header file, /inc/liblfds610.h and a single library file /bin/liblfds.*. The suffix of the library file varies by platform and by the type of library you have chosen to build (static or dynamic).
Testing and Benchmarking
The library comes with a command line test and benchmark program. This program requires threads. As such, it is only suitable for platforms providing thread support and which can execute a command line binary. Currently this means the test and benchmark program works for all platforms except the Windows Kernel.
For documentation, see the testing and benchmarking guide.
Porting
Both the test program and liblfds provide an abstraction layer which acts to mask platform differences. Porting is the act of implementing on your platform the functions which make up the abstraction layers. You do not need to port the test program to port liblfds, but obviously it is recommended, so you can test your port.
To support liblfds, the target platform must provide;
- atomic single-word1 increment
- atomic single-word compare-and-swap
- atomic contigious double-word compare-and-swap2
- malloc and free
- compiler directive for alignment of variables declared on the stack
- compiler directives for compiler barriers and processor barriers
1. A word here means a type equal in length to the platform pointer size
2. This requirement excludes the Alpha, IA64, MIPS, PowerPC and SPARC platforms
Also, the target plaform may provide;
- compiler keyword for function inlining
For documentation, see the porting guide (lfds).