Jump to page: 1 2 3
Thread overview
[Issue 15768] std.stdio.File does not support __gshared semantics of stdout/err/in
[Issue 15768] std.stdio.trustedStdout accesses __gshared data without synchronization.
Mar 06, 2016
Ivan Kazmenko
Jun 09, 2016
Jack Stouffer
Jun 10, 2016
Sobirari Muhomori
Jun 10, 2016
Sobirari Muhomori
Jun 10, 2016
Sobirari Muhomori
Jun 25, 2016
Walter Bright
Jul 21, 2016
Sobirari Muhomori
Jul 28, 2016
Jack Stouffer
Sep 25, 2016
Jack Stouffer
Jul 12, 2017
John Colvin
Jul 12, 2017
Jack Stouffer
Jul 17, 2017
Jack Stouffer
Jul 17, 2017
Jack Stouffer
Aug 16, 2017
anonymous4
Aug 16, 2017
anonymous4
Dec 10, 2017
Walter Bright
Feb 12, 2018
anonymous4
March 06, 2016
https://issues.dlang.org/show_bug.cgi?id=15768

Ivan Kazmenko <gassa@mail.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |gassa@mail.ru

--
June 04, 2016
https://issues.dlang.org/show_bug.cgi?id=15768

--- Comment #1 from github-bugzilla@puremagic.com ---
Commits pushed to stable at https://github.com/dlang/phobos

https://github.com/dlang/phobos/commit/92eed4f45ed01a5d1f975fb23859ea63473e6f5e Warn about Issue 15768

https://github.com/dlang/phobos/commit/02d1aedf6d3d001989ee342eae6d9fc6db61d399 Merge pull request #4401 from JackStouffer/patch-9

Warn about Issue 15768

--
June 09, 2016
https://issues.dlang.org/show_bug.cgi?id=15768

Jack Stouffer <jack@jackstouffer.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jack@jackstouffer.com

--- Comment #2 from Jack Stouffer <jack@jackstouffer.com> ---
In order for stdout, stdin, and stderr to be shared(File), I think File needs huge rewrites that will end up being backwards incompatible. Either that, or you need to write a second implementation of File that supports shared and has a lot less functionality.

--
June 10, 2016
https://issues.dlang.org/show_bug.cgi?id=15768

--- Comment #3 from Sobirari Muhomori <dfj1esp02@sneakemail.com> ---
I'd say follow TLS-cached singleton pattern, FILE* can be shared, but the reference counter must be separate.

--
June 10, 2016
https://issues.dlang.org/show_bug.cgi?id=15768

Sobirari Muhomori <dfj1esp02@sneakemail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |safe

--
June 10, 2016
https://issues.dlang.org/show_bug.cgi?id=15768

Sobirari Muhomori <dfj1esp02@sneakemail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|major                       |critical

--
June 25, 2016
https://issues.dlang.org/show_bug.cgi?id=15768

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |thecybershadow@gmail.com

--- Comment #4 from Walter Bright <bugzilla@digitalmars.com> ---
*** Issue 13443 has been marked as a duplicate of this issue. ***

--
July 20, 2016
https://issues.dlang.org/show_bug.cgi?id=15768

--- Comment #5 from github-bugzilla@puremagic.com ---
Commits pushed to master at https://github.com/dlang/phobos

https://github.com/dlang/phobos/commit/92eed4f45ed01a5d1f975fb23859ea63473e6f5e Warn about Issue 15768

https://github.com/dlang/phobos/commit/02d1aedf6d3d001989ee342eae6d9fc6db61d399 Merge pull request #4401 from JackStouffer/patch-9

--
July 21, 2016
https://issues.dlang.org/show_bug.cgi?id=15768

--- Comment #6 from Sobirari Muhomori <dfj1esp02@sneakemail.com> ---
(In reply to Jack Stouffer from comment #2)
> In order for stdout, stdin, and stderr to be shared(File)

1. shared(File) stdio will break code that consumes it as unshared
2. always doing interlocked counting for shared(File) is still slow, consider
this optimization: https://dpaste.dzfl.pl/d8dab5b7aa1f

--
July 28, 2016
https://issues.dlang.org/show_bug.cgi?id=15768

--- Comment #7 from Jack Stouffer <jack@jackstouffer.com> ---
(In reply to Sobirari Muhomori from comment #6)
> (In reply to Jack Stouffer from comment #2)
> > In order for stdout, stdin, and stderr to be shared(File)
> 
> 1. shared(File) stdio will break code that consumes it as unshared

Yup, and I don't see a way around that. Apparently when std.stdio was designed, shared still had bugs, so it wasn't used and __gshared was chosen instead. That was a huge mistake that we are now paying for. shared is the right choice here; this is specifically what shared was designed for.

OT: IMO anytime __gshared shows up in Phobos outside of C bindings, it's a bug. I don't care if it's using locks, or the code is slightly slower, we need to dog food shared if shared going to get any good.

> 2. always doing interlocked counting for shared(File) is still slow, consider this optimization: https://dpaste.dzfl.pl/d8dab5b7aa1f

You can further optimize with a new implementation by removing the ref count from a non shared File instance.

--
« First   ‹ Prev
1 2 3