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

Enable resolution of indirect object references when using worker processes #51

Merged
merged 10 commits into from
Jan 22, 2025

Conversation

dhdaines
Copy link
Owner

@dhdaines dhdaines commented Jan 22, 2025

It is somewhat of a hack, but not really, unless you have an irrational fear of global variables (news flash: functions, modules, and classes are also global objects).

Basically we just pass the id of the parent process' Document object to the workers, who just use this integer instead of a weak reference when creating ObjRef - it can be serialized when returned, and then we just look it up in a table ... of weak references ... to Document objects with worker processes.

We could of course We will in fact just do this for all indirect object references, all the time, which might be faster in single-threaded code too. which is not slower and also simplifies the code somewhat.

@dhdaines dhdaines merged commit 0099852 into main Jan 22, 2025
8 checks passed
@dhdaines dhdaines deleted the weakrefs_workers3 branch January 22, 2025 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant