digitalmars.D.ide - VisualD: Error disabling access to shared memory objects
- Nuno Leiria (11/11) Sep 28 2020 If I enable "disable access to shared memory objects (DMD
- Imperatorn (3/14) Sep 29 2020 Well, stdin is shared. And you have said you don't want to allow
- Nuno Leiria (5/7) Sep 30 2020 Thanks, can you please point me to a reference where I can learn
- Imperatorn (3/10) Oct 04 2020 https://dlang.org/spec/attribute.html
If I enable "disable access to shared memory objects (DMD 2.088+)" then this simple example doesn't compile: void main() { string line; while ((line = stdin.readln()) !is null) write(line); } It fails with the error: C:\D\dmd-2.094.0\windows\bin\..\..\src\phobos\std\stdio.d-mixin-4874(4874): Error: direct access to shared `stdin` is not allowed, see `core.atomic` Can anyone explain why?
Sep 28 2020
On Monday, 28 September 2020 at 22:10:58 UTC, Nuno Leiria wrote:If I enable "disable access to shared memory objects (DMD 2.088+)" then this simple example doesn't compile: void main() { string line; while ((line = stdin.readln()) !is null) write(line); } It fails with the error: C:\D\dmd-2.094.0\windows\bin\..\..\src\phobos\std\stdio.d-mixin-4874(4874): Error: direct access to shared `stdin` is not allowed, see `core.atomic` Can anyone explain why?Well, stdin is shared. And you have said you don't want to allow it.
Sep 29 2020
On Tuesday, 29 September 2020 at 22:16:55 UTC, Imperatorn wrote:Well, stdin is shared. And you have said you don't want to allow it.Thanks, can you please point me to a reference where I can learn more this behavior? I couldn't find anything about it. And is there a way to disable access to shared memory objects on a per function basis, rather than everything at once?
Sep 30 2020
On Wednesday, 30 September 2020 at 08:07:52 UTC, Nuno Leiria wrote:On Tuesday, 29 September 2020 at 22:16:55 UTC, Imperatorn wrote:https://dlang.org/spec/attribute.htmlWell, stdin is shared. And you have said you don't want to allow it.Thanks, can you please point me to a reference where I can learn more this behavior? I couldn't find anything about it. And is there a way to disable access to shared memory objects on a per function basis, rather than everything at once?
Oct 04 2020