Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Lock-free Queue #253

Merged
Merged
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
561d370
add libboost-dev dependency
saikishor Dec 19, 2024
2455b16
Add LockFreeBuffer class
saikishor Dec 19, 2024
02db30d
Add LockFreeSPSCQueueBase class
saikishor Dec 28, 2024
1468fe8
Add more functionality and tests
saikishor Dec 29, 2024
2ef8020
Add tests to CMakeLists
saikishor Dec 30, 2024
268138b
Draft: functional lockfree queue (not spsc_queue)
saikishor Dec 30, 2024
5e94cc9
Add more template enabled methods
saikishor Dec 31, 2024
34d03b5
update tests
saikishor Dec 31, 2024
6b629b1
Update the LockFreeQueue to completely support SPSC and MPMC queues +…
saikishor Dec 31, 2024
9a9951d
cleanup and change license
saikishor Jan 1, 2025
8c2c974
Update the documentation and add some minor tests
saikishor Jan 1, 2025
c991609
Merge branch 'ros-controls:master' into boost/lockfree/realtime/buffer
saikishor Jan 1, 2025
860029e
Add is_lock_free method
saikishor Jan 1, 2025
fe75f45
Update documentation
saikishor Jan 1, 2025
52f53b1
Add get_latest method to the LockFreeQueue
saikishor Jan 1, 2025
356d87e
update CMakeLists.txt
saikishor Jan 2, 2025
ac7ae53
Apply suggestions from code review
saikishor Jan 2, 2025
66dcdfd
Change template arg LockFreeSPSCContainer to LockFreeContainer
saikishor Jan 2, 2025
5d990c0
Install boost
christophfroehlich Jan 2, 2025
71321b3
cleanup the commented tests
saikishor Jan 2, 2025
4f61624
Update include/realtime_tools/lock_free_queue.hpp
saikishor Jan 3, 2025
9a8acdf
Update tests
saikishor Jan 3, 2025
ddb5ca9
Update condition for bounded push and update documentation
saikishor Jan 3, 2025
494b47d
Install boost in Windows CI
christophfroehlich Jan 3, 2025
8d1bae4
Unify empty method with internal conditioning of SPSC queue or MPMC q…
saikishor Jan 3, 2025
f90d22b
Try to set CMP0167 for boost on windows
christophfroehlich Jan 3, 2025
081d2f6
Remove quiet and add Boost::boost
christophfroehlich Jan 3, 2025
2f8d285
Remove atomic link libraries
christophfroehlich Jan 3, 2025
fff6ee3
Try to fix msvc atomic
christophfroehlich Jan 3, 2025
2bb6519
Try to fix atomic.lib on msvc
christophfroehlich Jan 3, 2025
551a9fb
Don't link atomic on windows
christophfroehlich Jan 3, 2025
689f63c
Use master branch of CI repo
christophfroehlich Jan 3, 2025
b8becad
Simplify push method and also add fixed_size arg to the MPMC queue
saikishor Jan 9, 2025
bd74a53
reuse tests to test all constructable types of LockFreeQueues
saikishor Jan 9, 2025
0d3fc7e
Merge branch 'master' into boost/lockfree/realtime/buffer
saikishor Jan 13, 2025
f764bc8
Merge branch 'master' into boost/lockfree/realtime/buffer
saikishor Jan 28, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
cleanup the commented tests
saikishor committed Jan 2, 2025
commit 71321b30e8d80f17a4e3121508ef215bd45a77de
46 changes: 0 additions & 46 deletions test/lock_free_queue_tests.cpp
Original file line number Diff line number Diff line change
@@ -219,52 +219,6 @@ TEST(LockFreeSPSCQueue, test_lockfree_queue_push)
ASSERT_EQ(consumer_count, iterations);
}

// TEST(LockFreeSPSCQueue, test_lockfree_queue_bounded_push)
// {
// LockFreeSPSCQueue<int, 100> queue;
// std::atomic_int producer_count = 0;
// std::atomic_int consumer_count(0);
// std::atomic_bool done(false);

// const int iterations = 1000000;

// std::thread producer([&]() {
// for (auto j = 0; j < iterations; ++j) {
// ASSERT_TRUE(queue.bounded_push(j));
// ASSERT_EQ(100, queue.capacity());
// ++producer_count;
// }
// });

// std::this_thread::sleep_for(std::chrono::milliseconds(100));

// std::cerr << "producer_count: " << producer_count << std::endl;

// std::thread consumer([&]() {
// int value;
// while (!done) {
// while (queue.pop(value)) {
// ++consumer_count;
// std::this_thread::yield();
// }
// }
// while (queue.pop(value)) {
// ++consumer_count;
// }
// });

// producer.join();
// done = true;
// consumer.join();

// std::cerr << "producer_count: " << producer_count << std::endl;
// std::cerr << "consumer_count: " << consumer_count << std::endl;
// std::cerr << "iterations: " << iterations << std::endl;
// ASSERT_GT(producer_count, consumer_count);
// ASSERT_EQ(producer_count, iterations);
// ASSERT_GT(iterations, consumer_count);
// }

TEST(LockFreeMPMCQueue, default_construct)
{
{