Page 1 of 1

Multi-threading with BlitzGateway

PostPosted: Tue Nov 27, 2018 9:10 pm
by etienne.dumoulin
Hi Omero developers,

We are currently running heavy image processes and we would like to multi-thread.

Unfortunately, I think the BlitzGateway object is getting locked when I call it from a different Thread. I have also tried to create one object instance by Thread without any success. Is there a way to create multi-threaded jobs connected to omero on a single machine?

Thank you for your time.

Regards,

Etienne

Re: Multi-threading with BlitzGateway

PostPosted: Wed Nov 28, 2018 8:46 am
by jmoore
Hi Etienne,

is it possible for you to share your code and show us which block you think is the bottleneck?

In general, I don't know of a single lock that would be causing you problems, unless perhaps you are accessing the same IO service from multiple threads. If that's the case, then creating multiple services will likely help with the only caveat being that you will have to keep overall memory usage in mind.

If it's a more underlying issue of BlitzGateway, then one possibility would be to share a single `omero.client` object between multiple gateway objects, but that's mostly a guess in the dark until we know what's causing your problems.

Cheers,
~Josh