-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Add material to stdio handling #973
Conversation
And here is how you would handle #899 (comment) with this design: Since you're writing a TUI, you're interacting with fds 0 and 1 directly anyway. Therefore, at the start of your program, you set Similarly this allows |
Unfortunately, the Windows console do not make cc #972 |
This RFC does not touch the raw versions. |
I might just not understand some fundamental limitation of the design space, but I'm curious why concurrent synchronization is being used ( |
+Unless other streams or another buffer mode has been explicitly specified via
+the thread-builder, these settings will be inherited by child-threads. |
Ah, I figured I had just missed something. |
I think making One question: are the raw versions tied to the process-level handles? That is, does I'm a little unsure about the exact signatures/locations of some of the functions proposed here, but I want to think a bit more about a possible alternative for concrete comparison. I'll try to do so soon. |
* `stdin` - wraps `thread::stdin`. All operations on `Stdin` directly | ||
will acquire the lock internally. A `lock` method is provided to acquire | ||
exclusive access to the stream for a period of time so that relocking is not | ||
necessary. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why lock on thread local streams?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are not thread local.
This RFC does not make any changes to the raw section which is marked as a sketch anyway. Raw handles will have to refer to the 0, 1, 2 fds on unix directly. |
Is there any way to make some of this more opt-in so threads that don't do IO don't need to carry all this baggage around? All the behind the signs dynamic dispatch and thread local stuff reminds me a bit of the old green/native IO system. I'm of the opinion that the standard streams are classic stupid arbitrary "singletons", and thus just plain bad design and holdovers from another era. The fact that we need to such things as are proposed here to fix them I take is evidence of the fact. I rather hook up panicking to the |
Four pointers and a few atomic operations when you create a thread.
You're suggesting removing thread local storage and println from the language. That's an interesting thought. |
RFC issue #1050 |
No description provided.