[ome-devel] Client side multi-threading

Josh Moore josh at glencoesoftware.com
Mon Jun 4 12:11:39 BST 2018


On Tue, May 29, 2018 at 6:51 PM, Etienne Dumoulin <etienne at phenomic.ai> wrote:
> Hi Omero developers,

Hi Etienne,


> I am currently creating histograms of pixel values for a given screen.
>
> The simplest method I found is to iterate on the data two times, first to
> find the extremes and then to count the number of pixels in each bin.

Did you see the findMinMax method as well? It's also per-image but may
get you the extremes you are looking for, with the added benefit of
using the values that are cached in the database where possible.


> You have a method getHistogram, but it runs on an image rather than on a set of
> images.

Ah, interesting idea. So as not to transfer the image data, a
getHistogram method taking a set of images would be a good idea.


> I have it working, but it is little bit slow, so I tried to
> multi-thread it using the Pool python object.
>
> Unfortunately, I think the BlitzGateway object is getting locked when I call
> it from a different Thread.

I don't know of any locking (beyond Python's Global Interpreter Lock)
that would happen on the client-side. That being said, the server will
prevent concurrent calls on the RawPixelsService. You could try
creating a pool of these.


> I have also tried to create one object instance
> by Thread without any success.

Instances of which class? Can you share the code?


> Is there a way to create multi-threaded jobs
> connected to omero on a single machine?

I would definitely assume so.


> Thank you for your time.
>
> Regards,
> Etienne

Cheers,
~Josh


More information about the ome-devel mailing list