Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why do we need SetDoNotWaitForThreads with windows 7 when linking to ITK statically #1028

Closed
Siron777 opened this issue Jun 18, 2019 · 2 comments

Comments

Projects
None yet
2 participants
@Siron777
Copy link

commented Jun 18, 2019

Hi,

We are using itk 5.0.0 as a static library on windows, with visual studio 2017. We have encountered some dead locks preventing the unit tests using ITK to terminate. This is only happening on windows 7, not windows 10. It seems that we need to use the method SetDoNotWaitForThreads (86b7cce).

I would like to get more information on the reason of this issue. Why is it only on windows 7 and not windows 10 ? The method SetDoNotWaitForThreads is a temporary work around to an unknown root cause ?

Thank you.

@dzenanz

This comment has been minimized.

Copy link
Member

commented Jun 18, 2019

I don't know why would there be a difference between Windows 7 and 10. Are you sure that nothing else is different?

As to why waiting for threads is needed in static case, but not dynamic, it is described in this comment. Essentially, in DLL case the OS has already killed the threads, so trying to wait for them causes a deadlock. Whereas in static case, if we don't wait for threads assertions in debug mode complain about not doing things right - in release mode it does not cause an issue because OS completely cleans up our resources shortly thereafter.

@dzenanz

This comment has been minimized.

Copy link
Member

commented Jul 15, 2019

Fixed by #1052.

@dzenanz dzenanz closed this Jul 15, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.