Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
pebal
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
10 ms
·
91.
▲
by
pebal
4y ago
- Some graph structures. The shared_ptr does not release circular data structures and has a lot of memory overhead. - Memory managing of concurrent containers. Lock-free algorithms requires GC or the hazard pointers and these are basically
92.
▲
by
pebal
4y ago
It is not a solution for all cases.
93.
▲
by
pebal
4y ago
GC can be faster and allocate less memory. tracked_ptr: 279.95ms (151MB) shared_ptr: 1035.07ms (480MB) source: https://godbolt.org/z/jP7ohPehY
94.
▲
by
pebal
4y ago
Disruption is a lower cost than the cost of executing the destructor by the mutator.
95.
▲
by
pebal
4y ago
SGCL executes the destructors in a separate thread, so there is no cost to the mutator.
96.
▲
by
pebal
4y ago
The intention of creating this project was the opposite. You only use the tracked pointer when it is beneficial.
97.
▲
by
pebal
4y ago
This introduces the tracked smart pointer. This pointer has less overhead than shared_ptr and releases circular data structures.
98.
▲
by
pebal
4y ago
Version 3 is more liberal.
99.
▲
Tracked_ptr – when shared_ptr is not enough
(github.com)
1 points
by
pebal
4y ago
|
1 comments
100.
▲
by
pebal
4y ago
Herb Sutter pointed out the need to add a tracked pointer to C++. He proposed the concept of deferred_ptr a few years ago. I implemented the tracked_ptr concept with one tracked heap. Advantages: - Thread safe - Does not use reference count
101.
▲
by
pebal
4y ago
Here is a working implementation: https://github.com/pebal/sgcl
102.
▲
by
pebal
4y ago
The hazard pointer is basically a proposal to implement GC to solve one implementing problem in C++26.
103.
▲
by
pebal
4y ago
> See also this answer: > https://stackoverflow.com/a/48046118/1593077 > to the question of why C++ doesn't have a garbage collector. The shared_ptr is an optional garbage collection based on referen
104.
▲
Lock-free Concurrent Garbage Collector for C++
(github.com)
1 points
by
pebal
4y ago
|
0 comments