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

Introduce Threaded Executions to the Runtime Server Instrument #606

Closed
8 tasks
kustosz opened this issue May 18, 2020 · 0 comments
Closed
8 tasks

Introduce Threaded Executions to the Runtime Server Instrument #606

kustosz opened this issue May 18, 2020 · 0 comments
Assignees
Labels
p-high Should be completed in the next sprint

Comments

@kustosz
Copy link
Contributor

kustosz commented May 18, 2020

Summary

The way the runtime server is implemented right now, we have no control over running Enso programs and execution is effectively blocking the rest of API.

Value

  1. We can control execution better in the future (e.g. abort / restart it on-demand).
  2. We can keep the servers active even if a long-running computation is executing.

Specification

  • Implement a message queue with worker threads (based on Executor.submit()). Jobs should be executed asynchronously.
  • Implement Context#createThread(...) that dispatches to TruffleLanguage.Env#createThread(...) instead of the standard Java thread primitives.
  • Refactor current handler to submit commands to the message queue.
  • Create a flow chart that describes the priorities and succession rules of the various incoming messages (should become part of the language docs). Messages in the handler can generate multiple jobs. In runtime docs, and these should account that concurrent modifications to the Context should not happen. (Marcin)
  • Determine and document the reordering rules for the generated jobs. In runtime docs.
  • Implement the reordering rules as specified.
  • Implement preemptive interruption of threads where necessary. This must use Thread.interrupt() (the java primitive).
  • Update the spec to reflect any protocol changes.

Acceptance Criteria & Test Cases

  • User code executes in threads asynchronously so as to not block or time out the language server.
  • The functionality is well documented and tested.
@lolczak lolczak closed this as completed Jun 16, 2020
@iamrecursion iamrecursion transferred this issue from another repository Jun 23, 2020
@joenash joenash added Category: Interpreter p-high Should be completed in the next sprint labels Jun 23, 2020
@iamrecursion iamrecursion mentioned this issue Jun 23, 2020
26 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p-high Should be completed in the next sprint
Projects
None yet
Development

No branches or pull requests

3 participants