C++ Logo

std-proposals

Advanced search

Re: SCC / ISO IEC - C++ Superset

From: Phil Bouchard <boost_at_[hidden]>
Date: Thu, 5 Aug 2021 15:39:38 -0400
So I would say:
- pointers internal to a module can use a simple shared_ptr (node_ptr_base);
- pointers shared across modules can use a cyclic-safe shared_ptr (node_ptr);
- iterators are simple raw pointers and the compiler will prevent you from incrementing / decrementing shared_ptr anyway.

--
Phil Bouchard
Founder
C.: (819) 328-4743
> On Aug 5, 2021, at 3:01 PM, Phil Bouchard via Std-Proposals <std-proposals_at_[hidden]> wrote:
> 
> 
> 
> 
>> On 8/5/21 2:48 PM, Miguel Ojeda wrote:
>>> On Thu, Aug 5, 2021 at 8:25 PM Phil Bouchard <boost_at_[hidden]> wrote:
>>> - The memory manager has the property of being deterministic so no new random race conditions are involved, as such with garbage collector.
>> That is a no then. Rust guarantees the absence of data races and UB in general.
> Root Pointer is thread safe as shown in my examples. I'll read more about the data races later, but general race conditions aren't gone with Rust:
> 
> https://doc.rust-lang.org/nomicon/races.html
> 
> 
> 
>> 
>>> - The only drawback is that sizeof(root_ptr) = sizeof(void *) x 4... but can be shrink to sizeof(void *) x 3;
>> So every pointer in the kernel would be triplicated? That is far from
>> ideal, even before discussing time costs.
> Each one of them is derived from the other so you can use it as a simple shared_ptr, or cyclic-safe shared_ptr. The latter is just sizeof(void *) x 2. Kernel programmers should be smart enough to use a unique type for iterators. My implementation is just very generic.
> 
> 
> 
>> Rust allows us to have more guarantees, without such a cost.
>> 
>> Cheers,
>> Miguel
> -- 
> 
> Phil Bouchard
> Founder & CTO
> C.: (819) 328-4743
> 
> 
> -- 
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals

Received on 2021-08-05 14:39:42