www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Can someone help a Reddit user

reply bachmeier <no spam.net> writes:
Someone has posted a question on our subreddit. Would be nice if 
he could get an answer:
https://www.reddit.com/r/d_language/comments/7yxwvm/why_do_my_threads_write_to_the_wrong_file/
Feb 20 2018
parent reply Steven Schveighoffer <schveiguy yahoo.com> writes:
On 2/20/18 2:00 PM, bachmeier wrote:
 Someone has posted a question on our subreddit. Would be nice if he 
 could get an answer:
 https://www.reddit.com/r/d_language/comments/7yxwvm/why_do_my_threads_writ
_to_the_wrong_file/ 
 
I responded. Looks to me like a race condition in the DMC libc code, but I don't have an environment set up to test at the moment. -Steve
Feb 20 2018
parent Steven Schveighoffer <schveiguy yahoo.com> writes:
On 2/20/18 2:52 PM, Steven Schveighoffer wrote:
 On 2/20/18 2:00 PM, bachmeier wrote:
 Someone has posted a question on our subreddit. Would be nice if he 
 could get an answer:
 https://www.reddit.com/r/d_language/comments/7yxwvm/why_do_my_threads_writ
_to_the_wrong_file/ 
I responded. Looks to me like a race condition in the DMC libc code, but I don't have an environment set up to test at the moment.
Wow, I didn't realize how bad DMC's FILE * was in terms of thread safety: http://bugzilla.digitalmars.com/issues/show_bug.cgi?id=327 I would highly recommend avoiding I/O on Win32, unless you are using Visual Studio libc, or using Windows handles directly. I can't believe it has been this bad and we haven't had mountains of bug reports on it. -Steve
Feb 21 2018