Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make CoreIO thread-safer #21893

Merged
merged 1 commit into from
May 16, 2017
Merged

Make CoreIO thread-safer #21893

merged 1 commit into from
May 16, 2017

Conversation

yuyichao
Copy link
Contributor

Reminded by https://discourse.julialang.org/t/status-of-threads/3729 that CoreIO isn't thread safe yet. This makes it safer.

It's pretty hacky and you can easily crash it if you pass in anything that's not STDIN or STDOUT but I think it's useful for debugging before the actual IO system is thread safe.

Now a thread safe show function can kind of be implemented as f(x) = Core.print(sprint(show, x)).

@yuyichao yuyichao added backport pending 0.6 multithreading Base.Threads and related functionality labels May 15, 2017
fd = STDERR_FILENO;
}
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rewrite to test for fd == -1?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure.... In case we have anyone that somehow closed the STDIN I guess?

Also test for `fd != -1` instead since that is a defined invalid value.
@yuyichao yuyichao merged commit ecf10a2 into master May 16, 2017
@yuyichao yuyichao deleted the yyc/threads/core-print branch May 16, 2017 20:10
tkelman pushed a commit that referenced this pull request May 17, 2017
Also test for `fd != -1` instead since that is a defined invalid value.

(cherry picked from commit 84eeb40)
ref #21893
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
multithreading Base.Threads and related functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants