Page MenuHomePhabricator

make interplay of image, imageaccessor and imagedataitem thread-safe
Closed, WontfixPublic

Description

See T13935

Event Timeline

Main problem is still the "WEAKPOINTER_PROBLEM_WORKAROUND" in mitkBaseData. However, switching off the workaround makes it impossible to use the Image class anymore. This is going to be fixed with the ITK4 migration, and therefore this bug depends on T10925.

Added some mutex locks as a workaround for T13324, which leads to inappropriate side effects on the image class. (See branch bug-14443-MakeImageAccessThreadSafe)

New remote branch pushed: bug-14443-MakeImageAccessThreadSafe

Additionally to the WEAKPOINTER_PROBLEM, which will be fixed with the ITK4 integration, there is another thread problem with the validity of ImageDataItems.
These get reinitialized when making sure, that the given image data is completely initialized. In parallel, this can lead to undefined values. As it can be seen in the ImageAccessorTest, random failes occur when creating ImagePixelReadAccessors concurrently, e.g. ImageDataItem->GetDimension() returns occasionally undefined values.

With the ITK4 migration, we finally got rid of the "WEAKPOINTER_PROBLEM_WORKAROUND"

The Problem with ImageDataItems still exists, however, in order to reactivate multi-threading in the ImageAccessorTest, a mutex was introduced to prevent parallel access of ImageDataItem->GetSliceData()

In the current bug-branch there is also a fix for T14574.
The branch will be merged after the release of 2013-06.

[2cd90b]: Merge branch 'bug-14443-MakeImageAccessThreadSafe'

Merged commits:

2013-06-26 16:50:17 Joseph Görres [21bff4]
reactivate multi-threading in ImageAccessorTest


2013-06-26 14:23:47 Joseph Görres [ae663d]
Merge remote-tracking branch 'origin/master' into bug-14443-MakeImageAccessThreadSafe


2013-04-03 17:29:20 Joseph Görres [dc5e13]
removed unnecessary steps


2013-02-13 14:59:05 Joseph Görres [441596]
added mutex locks for imagedataitem method calls with side-effects on the image class

[ea44ab]: Merge branch 'bug-14443-MakeImageAccessThreadSafe'

Merged commits:

2013-07-31 17:31:48 Joseph Görres [c220da]
COMP: made sure there is always a valid image data item

With T17931 merged, it should now be possible to remove the mutex from the test code and rely on a const image and hence thread-safe concurrent read access.

kislinsk added a subscriber: kislinsk.
This task was automatically closed because it wasn't updated at least since July 2016 (over 2 years). Please re-open this task if you think that it is still relevant. This most probably means that you will resolve it.