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

[RFC] Widget multiprocessing #86

Open
irgolic opened this issue Jul 28, 2020 · 1 comment
Open

[RFC] Widget multiprocessing #86

irgolic opened this issue Jul 28, 2020 · 1 comment

Comments

@irgolic
Copy link
Member

irgolic commented Jul 28, 2020

Today @ajdapretnar, @lanzagar, @PrimozGodec and I talked about making all Orange widgets run concurrently.

The goal is to never freeze the main canvas GUI thread/process. When a widget is doing something, its window can freeze, but other widgets and the canvas should still be interactable. The widget's NodeItem on canvas should display an indefinite loading animation.

Note: It's still great to multithread things within widget, this'll make the widget's window not freeze while the task is running.

@PrimozGodec noted that threads cannot be forcefully stopped, so they're not appropriate for this. With threads, the solution would have to check if it was signalled to stop every so often, which is not viable for large-scale concurrency.

A multi-process solution must be implemented. To a widget process, the outside world must be immutable. Communicating with the main process, it receives some input signal data and sends some output signal data.
The canvas end must wait for the widget's processing to finish without freezing up. So there should be a thread waiting for widgets to finish, and/or receiving outputs should be integrated into the Qt event loop?

@irgolic
Copy link
Member Author

irgolic commented Aug 28, 2020

What if this were a Python 3.8+ only feature, as it supports shared memory between processes?
https://docs.python.org/3/library/multiprocessing.shared_memory.html

Also, perhaps this should be implemented with multi-core support in mind for the future? (as I understand, Orange currently supports only single-core computation)
I suppose that's a discussion for another time.

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

No branches or pull requests

1 participant