Unused druntime code: Barrier, ReadWriteMutex, Condition
Richard (Rikki) Andrew Cattermole
richard at cattermole.co.nz
Mon Jun 15 09:59:06 UTC 2026
On 15/06/2026 9:41 PM, Denis Feklushkin wrote:
> On Monday, 15 June 2026 at 09:07:54 UTC, Richard (Rikki) Andrew
> Cattermole wrote:
>
>> There are enough primitives in FreeRTOS to build these other sync
>> primitives.
>
> Strictly, my question wasn't related to FreeRTOS.
>
> I just want to understand why we keep such code that we don't use
> directly in the druntime. This code complicates porting without
> providing any benefit. Moving this code to Phobos allows us to put this
> issue aside along with other similar ones (like std.file on systems
> without filesystem)
>
> One day we'll have to quickly port the language to something trendy. And
> we won't be ready for it.
>
>> There are enough primitives in FreeRTOS to build these other sync
>> primitives.
>
> Most likely, these primitives do not exist in any OS - they are too
> high-level and can be implemented on the basis of "more primitive"
> primitives. (Posix implementation just provides convient wrapper, I think)
They do.
Windows Internals 7th edition, part 2.
Page 205-206.
Reasoning mentioned is that it has performance benefits.
Its safe to assume some pthread implementations will have kernel backing
as well.
More information about the Digitalmars-d
mailing list