-
-
Notifications
You must be signed in to change notification settings - Fork 471
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
Set up Manual Threading how-to guide is highly problematic #6724
Comments
A shared thread that processes queued events sounds very complex, that's really what the nthreads config option is for.
Seems like an easy fix, just add a
Same thing.
Yeah, I don't think it's being used correctly, a simple Lock that guards reads and writes of the queue seems sufficient.
It's generally safe but of course if you have concurrent manipulation of the same component from multiple threads the standard precautions apply. |
Thx. I don't know enough about threads to understand the last too comments. Could you make those more explicit:
What would that look like in code terms?
What do you mean by standard precautions? What are they? Where can they be found?
How would you do this? I don't think nthreads config options would help here. |
I've been looking at the Set up Manual Threading multiple times and I think it will cause more harm the good.
import panel as pn
text.c = threading.Condition()
is nescessary I'm not sure the explanation is True. My understanding the Condition enables another thread to wait until a condition. And this is not what we do here. See https://docs.python.org/3/library/threading.html#condition-objects.Maybe use of session life cycle hooks are solution? https://panel.holoviz.org/how_to/callbacks/session.html.
Furthermore the guide only explains how to use manual thread in main
app.py
file that is not shared between sessions. I would also like to see an explanation of using a single shared thread in external module. As in #6723. I think here concerns about performance comes in. Should this thread be pushing updates to all sessions that.depends
on the threads updates? Or should each individual session be running a periodic callback to check for updates? What is most safe and performant?[x] Yes. I'm willing to contribute a PR updating the guide. But I need some guidance and more understanding to be able to do it.
The text was updated successfully, but these errors were encountered: