Show EOL distros:
Package Summary
The lockfree package contains lock-free data structures for use in multithreaded programming. These kinds of data structures are generally not as easy to use as single-threaded equivalents, and are not always faster. If you don't know you need to use one, try another structure with a lock around it first.
- Author: Josh Faust
- License: BSD
- Repository: ros
- Source: svn https://code.ros.org/svn/ros/stacks/ros_realtime/tags/ros_realtime-0.5.2
Package Summary
The lockfree package contains lock-free data structures for use in multithreaded programming. These kinds of data structures are generally not as easy to use as single-threaded equivalents, and are not always faster. If you don't know you need to use one, try another structure with a lock around it first.
- Author: Josh Faust
- License: BSD
- Source: git https://github.com/ros/ros_realtime.git (branch: master)
Package Summary
The lockfree package contains lock-free data structures for use in multithreaded programming. These kinds of data structures are generally not as easy to use as single-threaded equivalents, and are not always faster. If you don't know you need to use one, try another structure with a lock around it first.
- Author: Josh Faust
- License: BSD
- Source: git https://github.com/ros/ros_realtime.git (branch: master)
Package Summary
The lockfree package contains lock-free data structures for use in multithreaded programming. These kinds of data structures are generally not as easy to use as single-threaded equivalents, and are not always faster. If you don't know you need to use one, try another structure with a lock around it first.
- Author: Josh Faust
- License: BSD
- Source: git https://github.com/ros/ros_realtime.git (branch: master)
Package Summary
The lockfree package contains lock-free data structures for use in multithreaded programming. These kinds of data structures are generally not as easy to use as single-threaded equivalents, and are not always faster. If you don't know you need to use one, try another structure with a lock around it first.
- Maintainer status: maintained
- Maintainer: Devon Ash <dash AT clearpathrobotics DOT com>
- Author: Josh Faust
- License: BSD
- Source: git https://github.com/ros/ros_realtime.git (branch: hydro-devel)
Package Summary
The lockfree package contains lock-free data structures for use in multithreaded programming. These kinds of data structures are generally not as easy to use as single-threaded equivalents, and are not always faster. If you don't know you need to use one, try another structure with a lock around it first.
- Maintainer status: maintained
- Maintainer: Devon Ash <dash AT clearpathrobotics DOT com>
- Author: Josh Faust
- License: BSD
- Source: git https://github.com/ros/ros_realtime.git (branch: hydro-devel)
Package Summary
The lockfree package contains lock-free data structures for use in multithreaded programming. These kinds of data structures are generally not as easy to use as single-threaded equivalents, and are not always faster. If you don't know you need to use one, try another structure with a lock around it first.
- Maintainer status: unmaintained
- Maintainer: Devon Ash <dash AT clearpathrobotics DOT com>
- Author: Josh Faust
- License: BSD
- Source: git https://github.com/ros/ros_realtime.git (branch: hydro-devel)
Package Summary
The lockfree package contains lock-free data structures for use in multithreaded programming. These kinds of data structures are generally not as easy to use as single-threaded equivalents, and are not always faster. If you don't know you need to use one, try another structure with a lock around it first.
- Maintainer status: unmaintained
- Maintainer: Devon Ash <dash AT clearpathrobotics DOT com>
- Author: Josh Faust
- License: BSD
- Source: git https://github.com/ros/ros_realtime.git (branch: hydro-devel)
Package Summary
The lockfree package contains lock-free data structures for use in multithreaded programming. These kinds of data structures are generally not as easy to use as single-threaded equivalents, and are not always faster. If you don't know you need to use one, try another structure with a lock around it first.
- Maintainer status: unmaintained
- Maintainer: Devon Ash <dash AT clearpathrobotics DOT com>
- Author: Josh Faust
- License: BSD
- Source: git https://github.com/ros/ros_realtime.git (branch: hydro-devel)
Package Summary
The lockfree package contains lock-free data structures for use in multithreaded programming. These kinds of data structures are generally not as easy to use as single-threaded equivalents, and are not always faster. If you don't know you need to use one, try another structure with a lock around it first.
- Maintainer status: maintained
- Maintainer: Devon Ash <dash AT clearpathrobotics DOT com>
- Author: Josh Faust
- License: BSD
- Source: git https://github.com/ros/ros_realtime.git (branch: noetic-devel)
Contents
The lockfree package contains lock-free data structures generally meant to be used in realtime or high-performance multithreaded systems.
Currently lockfree contains 2 data structures, FreeList and ObjectPool.
FreeList
The FreeList class provides a fixed number of fixed-size blocks that you can allocate and free from multiple threads. FreeList is lock-free but not wait-free.
Example
ObjectPool<T>
While the FreeList class simply provides allocation of specific-sized blocks of memory, the ObjectPool class builds on top of that to provide allocation of specific object types, initialized using a template object. It also allows you to allocate either boost::shared_ptrs or bare pointers, depending on your needs. ObjectPool is lock-free but not wait-free.
Example
1 struct Foo
2 {
3 std::vector<uint32_t> bar;
4 };
5
6 // Create a template object. All objects in the pool will start initialized to this value.
7 // In realtime systems, for example, this lets you preallocate any vectors/strings/etc.
8 Foo template_object;
9 template_object.bar.resize(100);
10
11 // Construct a pool of 5 objects
12 ObjectPool<Foo> pool(5, template_object);
13
14 boost::shared_ptr<Foo> inst1 = pool.allocate();
15 if (inst1)
16 {
17 ...
18 }
19
20 Foo* inst2 = pool.allocateBare();
21 if (inst2)
22 {
23 ...
24 pool.freeBare(inst2);
25 }