-
Notifications
You must be signed in to change notification settings - Fork 8
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
Reset interpreter session and reuse the interpreter (isolation level) #114
Comments
Spawning and stopping an interpreter per file ensures that the interpreter is closed. If the next file to exec does not use that interpreter it is okay. We need to ensure that the interpreter is shutdown if no other file will require it. Offtopic: it would be interesting to make |
If we don't want to force a shutdown and the runner supports a reset(), do it instead of a shutdown. A reseted runner will still be alive and a subsequent initialization will be skipped. This allows the runner to implement a reset of the interpreter's state instead of a full shutdown/re-spawn. Documented runner's initialize(), reset() and shutdown() and refactored FileExecutor's initialize_runners() and shutdown_runners() (now called reset_runners()). This should backward compatible. FileExecutor for now it always force a shutdown so the whole thing works as before. Also it is missing the shutdown of the still alive runners.
At the end of the job, after processing all the files, call close on FileExecutor and Harvester. This allows to do clean up stuff like shutting down any runner still alive in the FileExecutor.
If we don't want to force a shutdown and the runner supports a reset(), do it instead of a shutdown. A reseted runner will still be alive and a subsequent initialization will be skipped. This allows the runner to implement a reset of the interpreter's state instead of a full shutdown/re-spawn. Documented runner's initialize(), reset() and shutdown() and refactored FileExecutor's initialize_runners() and shutdown_runners() (now called reset_runners()). This should backward compatible. FileExecutor for now it always force a shutdown so the whole thing works as before. Also it is missing the shutdown of the still alive runners.
At the end of the job, after processing all the files, call close on FileExecutor and Harvester. This allows to do clean up stuff like shutting down any runner still alive in the FileExecutor.
Describe the feature you'd like
For each file,
byexample
spawns an interpreter to run the examples and it will shutdown after processing the file.If multiple files have examples of the same language,
byexample
will still spawn and shutdown the interpreter for each file.This is quite slow.
Some interpreters have the concept of
sessions
: independent execution sessions with a clean environment.We could use it to reset the session instead of spawning another interpreter which it should be much faster.
This opens several isolation levels:
byexample
must still do some clean up like resetting the clipboard (isolation == none is not a way to concatenate files)The text was updated successfully, but these errors were encountered: