-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
main task needs to run on the main OS thread #2058
Comments
Here's the current plan. The main task continues to be non-special, but we create another single-threaded scheduler called 'main_thread_sched' that has a single scheduler thread running on the OS main thread. Users can choose to spawn tasks into this scheduler. Requires giving schedulers a first class representation in core, reworking how scheduler lifetime works, and refactoring a bunch of runtime code. |
What a charming asymmetry. Full steam ahead! |
Is that bit of flexibility worth such a convoluted solution? What's wrong with the user limiting their calls to those few libraries (like cocoa) to the main task? |
@Jonanin that's a point worth considering. My concern previously was that making the main task special could have some subtle, non-obvious side effects. Off hand this is what I can think of:
|
Of course, to combat that last point we could have the main task in it's own single-threaded scheduler and configured to spawn new tasks into a second scheduler that is more fair. |
That in itself (the main thread spawning into a different scheduler) is some subtle behavior though that I'm not sure the implications of. |
Not that it counts, since I don't know the full implications or full architecture of the system, but I vote for putting the main task in its own thread =] |
brson, the initial design sounds right. There are too many downsides to having the main task always on the main thread. Better to have each consumer of an os API have to request to be on the main thread if it needs to be. |
Implemented as a special scheduler. |
We now store Kani's version and the failure reason (if there's one) into the assess metadata. For now, we still need to manually parse this information, but this moves us closer to rust-lang#2058 and rust-lang#2165. In order to collect more details about the compilation errors, we now inspect the cargo diagnostic messages.
In some operating systems (mac, win) the main thread is special and can do special things (on mac you have to be on the main thread to do cocoa API calls). Somehow we probably need to arrange for the main task to run on the main thread, which is a pain.
The text was updated successfully, but these errors were encountered: