Skip to content

Determine a multithreading solution #31

@gselzer

Description

@gselzer

Most existing Ops rely on DefaultChunker when they wish to multithread a process. This process is more complicated to introduce in scijava-ops because:

  1. It requires all ops that want to multithread to require an ExecutorService as a parameter, something that could/should be injectable by the OpService.
  2. The tests for this Op introduce junitbenchmark; it would be nice if we did not have to introduce this.

There are a few different approaches that we can take:

  1. Create some sort of static method that mimics the behavior of Chunk
  2. Add support for what is going on in Unify multithreading handling imglib/imglib2-algorithm#81

Would it be possible to create a special mutlithreading OpDependency that, upon discovery, the matcher could inject its ThreadService into? i.e. if you had a

@OpDependency(name = "thread.chunker")
private NullaryComputer<Chunk> chunkerOp;

Ops could find a Computer that takes an ExecutorService as input and wrap that into a NullaryComputer by injecting its ExecutorService?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions