www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - Mir Algorithm 3.4.1 - RCArray and RCPtr

reply 9il <ilyayaroshenko gmail.com> writes:
Thread safe RC Array and Ptr. Plus C++ headers for code 
integration.

https://github.com/libmir/mir-algorithm
Docs:
http://mir-algorithm.libmir.org
http://mir-algorithm.libmir.org/mir_rc_array.html
http://mir-algorithm.libmir.org/mir_rc_ptr.html

Also, Ndslice and Series RC wrappers are available:







mir.qualifier from mir-core library contains useful utilities to 
work with RC and/or const data.

1. lightScope - returns a rc-free view of a Slice/Series. For 
example, for Slice!(RCI!double) it returns Slice!(double*)

2. lightConst - returns a mutable Slice/Series view to constant 
data. In terms of Phobos: it converts a constant range structure 
to a mutable range structure with constant elements.

3. lightImmutable  - the same for immutable qualifier

DMD related regression:
https://issues.dlang.org/show_bug.cgi?id=19774

and a new bug:
https://issues.dlang.org/show_bug.cgi?id=19793

This work has been sponsored by Symmetry Investments and Kaleidic 
Associates.

http://symmetryinvestments.com/
https://github.com/kaleidicassociates/

Best,
Ilya
Apr 23 2019
parent reply jmh530 <john.michael.hall gmail.com> writes:
On Wednesday, 24 April 2019 at 01:34:58 UTC, 9il wrote:
 Thread safe RC Array and Ptr. Plus C++ headers for code 
 integration.

 [snip]
Cool. Does this make any use of DIP1000? How is the run-time/memory performance vs. the GC versions?
Apr 24 2019
next sibling parent Atila Neves <atila.neves gmail.com> writes:
On Wednesday, 24 April 2019 at 10:52:14 UTC, jmh530 wrote:
 On Wednesday, 24 April 2019 at 01:34:58 UTC, 9il wrote:
 Thread safe RC Array and Ptr. Plus C++ headers for code 
 integration.

 [snip]
Cool. Does this make any use of DIP1000? How is the run-time/memory performance vs. the GC versions?
Can't answer for mir, but automem uses DIP1000: https://github.com/atilaneves/automem I haven't profiled it against "the GC version", but it would highly depend on the allocators used and the application.
Apr 24 2019
prev sibling parent reply 9il <ilyayaroshenko gmail.com> writes:
On Wednesday, 24 April 2019 at 10:52:14 UTC, jmh530 wrote:
 On Wednesday, 24 April 2019 at 01:34:58 UTC, 9il wrote:
 Thread safe RC Array and Ptr. Plus C++ headers for code 
 integration.

 [snip]
Cool. Does this make any use of DIP1000? How is the run-time/memory performance vs. the GC versions?
RC types are created to be used with DIP1000. Plus, Mir Algorithm used in production with this DIP. See configuration "dips" [1] Well, the allocator support is not ready yet. But the mir_rc_context already contains `void* allocator` that will be replaced in the future with nothrow nogc allocator interface (maybe this or next year). For now, Mir RC types are like a C++ shared_ptr without allocators and with the same performance. 1. https://github.com/libmir/mir-algorithm/blob/master/dub.sdl#L26
Apr 24 2019
parent jmh530 <john.michael.hall gmail.com> writes:
On Wednesday, 24 April 2019 at 14:05:28 UTC, 9il wrote:
 [snip]

 RC types are created to be used with DIP1000. Plus, Mir 
 Algorithm used in production with this DIP. See configuration 
 "dips" [1]

 Well, the allocator support is not ready yet. But the 
 mir_rc_context already contains `void* allocator` that will be 
 replaced in the future with nothrow  nogc allocator interface 
 (maybe this or next year). For now, Mir RC types are like a C++ 
 shared_ptr without allocators and with the same performance.

 1. 
 https://github.com/libmir/mir-algorithm/blob/master/dub.sdl#L26
Thanks.
Apr 24 2019