53 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
3
votes
1
answer
256
views
Which memory ordering to use in lockless linked-list stack pop() implementation?
I stumbled into an interesting issue -- when it comes to intrusive lockless stacks (single-linked lists) it seems there is a consensus on how push() should look like. All internet/AI searches (and ...
1
vote
0
answers
43
views
How to use tiny pointer with boost::intrusive::rbtree?
I need a custom boost::intrusive::rbtree whose node_ptr is uint32_t. All nodes are allocated from a array. So its node_ptr(pointer to left child, right child and parent) can be uint32_t but not void *....
2
votes
1
answer
62
views
can I use boost::intrusive::rbtree with stateful_value_traits?
I saw the example boost::intrusive doc_stateful_value_traits (see below). I need a custome rbtree with stateful_value_traits just like that.
I've tried but failed. rbtree_algorithms.hpp use ...
2
votes
1
answer
109
views
Is this header a good use case for `_Generic` in C?
I am writing a library of intrusive data structures in C. Many of these containers will share functionality. For example, there will be many containers that offer forward and reverse iteration. So, I ...
1
vote
2
answers
231
views
tbb parallel_for: Object with intrusive list node can be part of only one intrusive list simultaneously
I'm currently porting a program that was originally written on Windows 10 to a redhat system (VERSION_ID="8.8") that has g++ version 8.50. 20210514 (Red Hat 8.5.0-18). I installed tbb with ...
3
votes
3
answers
1k
views
Memory Alignment warning with gcc
I'm trying to implement a polymorphic data structure e.g. an intrusive linked list (I already know the kernel has one - this is more of learning experience).
The trouble is casting a nested struct to ...
1
vote
2
answers
1k
views
How to implement intrusive data structures in C++11?
I am porting to C++11 a C code base that makes use of a number of custom intrusive data structures.
In C, the usage patterns will typically look like this:
struct foo {
// some members
struct ...
2
votes
0
answers
209
views
Missing merge and split for boost AVL trees?
Boost provides boost::container::set/map/multiset/multimap where the underlying binary-search-tree (BST) can be configured, and it can be chosen to be an AVL tree.
One (maybe the most crucial one) ...
1
vote
1
answer
948
views
How to use boost::intrusive_ptr with boost::intrusive::list?
I want to allocate an object exact one time and push it to few lists. How can I do this with boost::intrusive_ptr and boost::intrusive::list? Or should I use another container and reference counter?
0
votes
1
answer
444
views
C++ STL - Containers implementation
I am currently learning a lot about Intrusive Containers. So I often compare them to the standard containers.
Let's take the std::list for example. I read that this container is usually implemented ...
1
vote
1
answer
218
views
Boost.Intrusive Containers - Elements with different size
In the Boost.Intrusive docs in the chapter "When to use?" https://www.boost.org/doc/libs/1_72_0/doc/html/intrusive/usage_when.html, it is stated that you can use intrusive containers containing ...
2
votes
1
answer
993
views
Do Intrusive containers still have performance advantages over non-intrusive ones in modern C++?
Do Boost.Intrusive containers still have performance advantages over non-intrusive standard (std::) ones in the modern C++ (with move semantic, emplace_back, etc)?
0
votes
2
answers
457
views
Why boost intrusive list 's push_back function requires lvalue?
I am learning intrusive list:
#include <iostream>
#include <list>
#include <boost/intrusive/list.hpp>
struct DummyObject : public boost::intrusive::list_base_hook<>{
double ...
0
votes
0
answers
148
views
How to hide Boost intrusive list hook ?
In the following code:
using namespace boost::intrusive;
struct Data {
int i;
private:
list_member_hook<> list_node; // How to make this work?
};
using List = list<
Data,
...
1
vote
1
answer
540
views
boost::instrusive::list with the auto-unlink hook: can I use a value in the list to determine if the list has exactly one element?
I have a boost::intrusive::list<Foo, constant_time_size<false>>, where Foo inherits from the list_base_hook<auto_unlink> hook. With a list element foo, I am able to get its iterator ...