Thread overview
[Issue 15129] std.parallelism.parallel doesn't enforce shared-correctness
May 24, 2022
timon.gehr@gmx.ch
Dec 17, 2022
Iain Buclaw
Jan 16, 2023
Nick Treleaven
Jan 16, 2023
Nick Treleaven
November 05, 2021
https://issues.dlang.org/show_bug.cgi?id=15129
Issue 15129 depends on issue 11043, which changed state.

Issue 11043 Summary: Context pointer of delegate should be const qualified https://issues.dlang.org/show_bug.cgi?id=11043

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |DUPLICATE

--
May 24, 2022
https://issues.dlang.org/show_bug.cgi?id=15129
Issue 15129 depends on issue 1983, which changed state.

Issue 1983 Summary: Delegates violate const https://issues.dlang.org/show_bug.cgi?id=1983

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--
May 24, 2022
https://issues.dlang.org/show_bug.cgi?id=15129
Issue 15129 depends on issue 1983, which changed state.

Issue 1983 Summary: Delegates violate const https://issues.dlang.org/show_bug.cgi?id=1983

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |---

--
May 24, 2022
https://issues.dlang.org/show_bug.cgi?id=15129
Issue 15129 depends on issue 1983, which changed state.

Issue 1983 Summary: Delegates violate const https://issues.dlang.org/show_bug.cgi?id=1983

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|---                         |WORKSFORME

--
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=15129

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P1                          |P3

--
January 16, 2023
https://issues.dlang.org/show_bug.cgi?id=15129

Nick Treleaven <nick@geany.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |safe
                 CC|                            |nick@geany.org

--- Comment #1 from Nick Treleaven <nick@geany.org> ---
> it is sufficient for the context to be const, otherwise it probably needs to be immutable.

`i` should be declared `shared` for safe mutation. To support that, the ParallelForeach.opApply delegate context parameter should require `shared` (which would allow `immutable` too). Unfortunately the opApply delegate doesn't support `shared` (or `immutable`) context inference AFAICT.

--
January 16, 2023
https://issues.dlang.org/show_bug.cgi?id=15129

--- Comment #2 from Nick Treleaven <nick@geany.org> ---
Both of these are examples of possible data races that should've been detected: https://issues.dlang.org/show_bug.cgi?id=23624 https://issues.dlang.org/show_bug.cgi?id=23634

--