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

Allowing a plugin to run in its own thread #8

Open
HughMacdonald opened this issue Mar 20, 2011 · 4 comments
Open

Allowing a plugin to run in its own thread #8

HughMacdonald opened this issue Mar 20, 2011 · 4 comments

Comments

@HughMacdonald
Copy link

Hi,

I've just recently moved over to using the latest (gh-perPluginLog) branch of shotgunEvents.

I've got a couple of plugins here - one of which is very quick to run, and another which can take a bit of time... (I'm working on optimising it...!)

I'd love to be able to put the slower one in its own thread, so the quicker plugin can still do its own thing without having to wait for the slower one...

@pboucher
Copy link

I've done some thinking on how things could be multi-threaded but one of my concerns is one of multiple plugins running operations that could be dependent on processing order.

Maybe a possible solution could be to specify on callback registration if the callback should be processed in its own thread. Once you've done that, it would be your responsibility to make sure your plugin isn't dependent on other plugins in a problematic way.

Thoughts?

@HughMacdonald
Copy link
Author

Yup - that's what I was thinking. A plugin would have to explicitly specify that it wants to run in a separate thread. Most plugins would just stick with running in the main thread.

@cmihaly
Copy link

cmihaly commented Jan 9, 2012

Also, unfortunately, the underlying socket library being used is NOT thread safe. We actually have threaded applications calling shotgun and figured this out. We have are own thread safe version of shotgun API (it is thread safe by locking, which means it serialized all threaded operations). So if you want to do this, you will have to use multi process vs multi threading (which actually gets around the python interpreter lock as well).

@aoblet
Copy link

aoblet commented Jan 9, 2020

Resurrecting this topic!
Is this something completely abandoned ? Would be interesting indeed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants