78 Commits

Author SHA1 Message Date
Alexander Grund
1a5af26128 CMake: Fix required C++ standard
cxx_std_14 is only available since CMake 3.8
The CXX_STANDARD_REQUIRED property is a boolean, i.e. ON or OFF not a numeric value. The feature is enough to require the standard already

In the test the specification is not required as the library sets it
2025-09-06 22:10:39 +08:00
Tim Blechmann
7d37abb303 CMake: add option for increasing the stresstest threshold 2025-04-06 10:16:01 +08:00
Tim Blechmann
f296538906 CMake: fix CXX_STANDARD_REQUIRED property
Fixes #114
2025-04-05 09:59:35 +08:00
Jan Palus
fbd28c03b9 include <cstdint> in all files using fix width integer types 2025-04-05 09:50:09 +08:00
Tim Blechmann
d8c13b2ba3 lockfree: clean up alignment
* use alignas
* use constexpr variable instead of preprocessor define
2024-12-27 12:48:11 +08:00
Tim Blechmann
ba92d67923 tests: appleclang compile fix 2024-12-15 09:33:48 +08:00
Tim Blechmann
c5329ddf9f lockfree: implement spsc_value
spsc_value is a single-producer single-consumer value implemented as a
lockfree triple-buffer.
2024-12-08 08:15:39 +08:00
Tim Blechmann
4ef74dac10 tests: silence warning 2024-12-08 08:15:39 +08:00
Tim Blechmann
26a0337fdd Tests: fix interprocess test case
Fixes: #103
2024-09-25 08:55:51 +08:00
Rene Rivera
a1385a0ea4 Update inter-lib build dependencies. 2024-08-19 09:04:16 +08:00
Rene Rivera
0cfe38b356 Make the library modular usable. 2024-08-19 09:04:16 +08:00
Tim Blechmann
e650f56778 modernisation: introduce uses_optional api 2024-05-04 11:18:35 +08:00
Tim Blechmann
5e9bc81d9c stack/spsc_queue - introduce move semantics 2024-05-04 10:15:30 +08:00
Tim Blechmann
6a70a658aa modernisation: use c++14 where possible 2024-05-03 21:45:54 +08:00
Tim Blechmann
fdbccb9253 build system: fix cmake tests 2023-12-17 15:11:40 +08:00
Tim Blechmann
f2a934205e cmake: add boost_lockfree_test_common for better ide integration 2023-11-23 13:13:44 +08:00
Tim Blechmann
e04bf59236 stack/queue - add missing allocator ctor 2023-11-03 21:33:09 +08:00
Tim Blechmann
bafa33be67 tests: cleanups 2023-11-03 14:59:50 +08:00
Tim Blechmann
8b25ed24db tests: use modern boost.test macros 2023-11-03 14:59:50 +08:00
Tim Blechmann
e3b6eb8d1f tests: silence warnings 2023-11-03 14:59:50 +08:00
Tim Blechmann
3ccac29ae3 import pre-commit and clang-format 2023-11-03 14:59:50 +08:00
Tim Blechmann
dba9b10b2b build system: polish cmake build system 2023-11-03 14:59:50 +08:00
msuvajac
af906f5745 stack, spsc_queue: don't create temporaries when deleting elements
When destructors/reset() are called temporary object was being created.
That creates issues when element doesn't have default initialization
(e.g. Boost.Interprocess containers).
2021-09-17 10:14:38 +02:00
Tim Blechmann
2ed9300ad5 tests: c++03 compatibility 2021-04-18 12:10:53 +08:00
Tim Blechmann
f568ba9319 spsc_queue: fix destruction of elements
the compile-time sized implementation did not properly destroy the
elements.

fixes #66
2021-03-25 15:04:35 +08:00
Austin Beer
41570c256e Fix CI failures with clang on Linux
LLVM generates atomic library calls that must be satisfied
https://llvm.org/docs/Atomics.html#libcalls-atomic
2019-12-05 17:35:26 -07:00
liang zhou
4ef74379c2 Why modify freelist_test.cpp and test_common.hpp :
In VxWorks Kernel, the re-schedule mechanism does not enable "round-robin" reschdule between the same priority tasks by default. So the case "stack_unbounded_stress_test" will lead to test case hang forever. Here's the details:

The test case creates 4 tasks as “Reader”, and then 4 tasks as “Writer”, all those 8 task has the same priority 220.
If the target has 2 cores, the first 2 reader tasks will occupy the cores by “while (1)” without yield, so the other 2 readers tasks and 4 writers tasks have no chance to be run.
This will lead to the test case loop forever , then the exp scrip will catch it and print “RTP Execution Timeout; rebooting”

The test case creates 4 tasks as “Reader”, and then 4 tasks as “Writer”, all those 8 task has the same priority 220 in VxWorks Kernel.
If the target has 2 cores, the first 2 reader tasks will occupy the cores by “while (1)” without yield, so the other 2 readers tasks and 4 writers tasks have no chance to be run.
This will lead to the test case loop forever without any ending.

Why modify spsc_queue_stress_test.cpp :
In VxWorks user-land task (Wind River calls it as RTP), the max number of objects (the internal data structure RTP uses) in one RTP is limited at most 65535.
When the test is selected to run, the C++ constructor will create 1<<16 number of mutex via "new spsc_queue_tester".
And after test1->run() is finished, the C++ destructor will delete 1<<16 number of mutex by default.
This caused the problem, because VxWorks just support ((1<<16)-1) objects within an RTP.
2018-11-12 15:25:39 +08:00
Tim Blechmann
ffa371d6d8 build system: fix travis integration 2018-11-05 16:14:55 +08:00
Tim Blechmann
dcaba572e8 testsuite: avoid namespace std 2018-03-28 10:08:50 +02:00
Tim Blechmann
8e98981c21 Merge pull request #32 from DanielaE/fix/missing-include
Fix compilation errors regarding undefined symbol 'cout' because of m…
2017-05-20 17:10:49 +02:00
Daniela Engert
7b63352a00 Conditionally replace deprecated/removed std::auto_ptr by std::unique_ptr.
Signed-off-by: Daniela Engert <dani@ngrt.de>
2017-05-12 17:30:54 +02:00
Daniela Engert
582b27bf0b Fix compilation errors regarding undefined symbol 'cout' because of missing include <iostream>.
Signed-off-by: Daniela Engert <dani@ngrt.de>
2017-05-12 17:27:31 +02:00
Tim Blechmann
400226ad43 lockfree: introduce a foward header 2016-07-29 21:27:37 +02:00
Tim Blechmann
3b58aa9af1 stack: implement consume_all_atomic_reversed 2016-07-26 13:32:42 +02:00
Tim Blechmann
cf6632e262 stack: implement consume_all_atomic 2016-07-26 12:21:04 +02:00
Tim Blechmann
eb21dd050b test: fix testsuite 2015-10-04 15:08:20 +02:00
Tim Blechmann
6454f9fb85 spsc_queue: fix reset() 2014-11-08 23:32:33 +01:00
Marcel Raad
9b127e5da9 Add missing includes
This fixes the compile breaks in the regression tests.
2014-09-29 17:49:03 +02:00
erenon
d77e119bac spsc_queue: non-const T& front() added and tested 2014-06-26 08:49:51 +02:00
erenon
66dae3a792 add T& front() and void pop() capabilities to spsc_queue 2014-06-25 19:16:08 +02:00
Tim Blechmann
38ea6b082b jam file fix 2014-04-09 19:20:54 +02:00
Tim Blechmann
da5ec85778 lockfree: spsc-queue - add read_available and write_available members
[SVN r86736]
2013-11-17 10:49:47 +00:00
Tim Blechmann
4663348be0 lockfree: use lock_guard instead of the deprecated boost::mutex::scoped_lock
fixes #8838

[SVN r85196]
2013-08-03 09:08:32 +00:00
Tim Blechmann
85fd0b1356 lockfree: explicitly use bitmask to prevent aba tag overflow
workaround for msvc run-time check failure

[SVN r84723]
2013-06-10 12:31:38 +00:00
Tim Blechmann
d9f89ec5c9 lockfree: prevent warnings for unused arguments
Signed-off-by: Tim Blechmann <tim@klingt.org>

[SVN r84618]
2013-06-03 09:48:47 +00:00
Tim Blechmann
b6c2f7cf1e lockfree: fix stack::reserve
[SVN r84403]
2013-05-21 15:24:20 +00:00
Tim Blechmann
65cb3432d1 lockfree: spsc-queue - capacity should take the internal marker object into account
fixes #8560

[SVN r84387]
2013-05-20 09:28:56 +00:00
Tim Blechmann
421e9d8c2c lockfree: testsuite - possible compile fix for IBM compiler
[SVN r83277]
2013-03-03 13:18:31 +00:00
Tim Blechmann
7388036785 lockfree: testsuite - move stress tests to separate file
[SVN r83276]
2013-03-03 13:13:01 +00:00
Tim Blechmann
e8e89220f6 lockfree: introduce consume_one and consume_all methods
[SVN r83275]
2013-03-03 13:07:50 +00:00