Skip to content

Generator::resetRegions() method called from computeThread causes crash #375

@jvlyndark

Description

@jvlyndark

Due to threading issues, the Generator::resetRegions() method cannot be called from the computeThread (which contains Generator + its descendant classes and ComputeEngine). This is because the GeneratorRegionSets, which are responsible for creating, destroying, and resetting generator I/O regions, have been consciously moved to the mainThread

As a result, calling resetRegions() by the class that implements it (Generator), or any class on computeThread, causes the program crash.

Instead, resetRegions() must be called on mainThread by the GeneratorModel class (see example in Header.qml, line 192), which connects to the GeneratorFacade associated with the specific Generator. This is done to allow the generator facades to more seamlessly connect with the QML Engine / UI which also live on mainThread.

Possible fixes include:

  • moving the GeneratorRegionSet and GeneratorRegion classes back to computeThread (has tradeoffs and is possibly a bigger job)
  • creating a Q_PROPERTY or QMetaObject system that works around this issue (attempts at doing this have revealed it won't be straightforward but still may be possible)

Metadata

Metadata

Assignees

No one assigned

    Labels

    C++QMLbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions