-
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
[WIP] Interpreter Pool Executor #4
base: main
Are you sure you want to change the base?
Conversation
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.
These look great!
Feel free to ask any general questions about the architecture around -
There are a few things I had started, and got stalled because I then decided to pursue another path.
Merge these at will -
# .intno and .id are both set to the interpreter id, | ||
# but .intno is set to None when the interpreter is closed. | ||
self.intno = self.id = None | ||
self.name = name |
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.
could you also add name to __repr__
in the same batch?
@@ -41,8 +41,8 @@ class FuncData(StructBase): | |||
def _dispatcher(pipe, buffer): |
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.
this is in a very early stage - but the concept looks fine: a looping listener function in each interpreter tied to a queue which will send different tasks - which could be run a function, spin a thread, and so on.
I am thinking of doing away with the "PipedInterpreter" altogether, and have an optional post-start call which would start such a listenner function. The InterpreterPoolExecutor would do it automatically.
Just let me know if you have a different idea to approach this.
@@ -41,8 +41,8 @@ class FuncData(StructBase): | |||
def _dispatcher(pipe, buffer): | |||
"""the core running function in a PipedInterpreter | |||
|
|||
This is responsible for watching comunications with the parent | |||
interpreter, dispathing execution, and place the return values | |||
This is responsible for watching communications with the parent |
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.
as you can see, my code editor does not spell check English - :-) I always have a hard time with doubled consonants.
It doesn't work at the moment. I'm still building on it. It's almost a carbon copy of the thread worker pool. The worker queue and callbacks can't be pickled, so we need a way of dispatching work to the pool. The interpreter queue might do the trick |
64ee87e
to
ce004a7
Compare
695aaa7
to
fcfa810
Compare
This is a sketch as I'm trying to build it out and this PR can just be a way of highlighting challenges.
Branch of #3