-
Notifications
You must be signed in to change notification settings - Fork 3
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
Concurrent Grading using asyncio #33
Conversation
Output from threads is now, by default, printed unless suppress_output is enabled. Output is printed at the end of the thread by the thread (not as it is retrieved). This reduces the chance that two threads will print at once, but it's still possible. Do we want to do a mutex lock on stdout here? ie: https://docs.python.org/3/library/threading.html#condition-objects |
I think it'd be nice to have printing synchronous, but not a requirement. |
@LinuxMercedes added print lock |
@brhoades i think there's a more idiomatic way to synchronize output without using a |
""" | ||
logger.info("Grading submission for %s", submission.user_id) | ||
output = submission.grade( | ||
rebuild_container=rebuild, show_output=False) |
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.
@brhoades is this an unbalanced parenthesis?
a972380
to
d15b772
Compare
This PR is almost as old as my career. Closing it out. |
I've drafted concurrent grading using asyncio coroutines (threads instead of processes). By default, it's synchronous, but if -j is specified it uses that many worker threads.
It's currently NOT printing output as I'm not sure if that's desirable / if print locks stdout until it finishes.
Implements #21
Default (unchanged) behavior:
and with concurrency: