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

Hang can occur during Python threading #3087

Closed
lbiasco-sie opened this issue May 16, 2024 · 3 comments
Closed

Hang can occur during Python threading #3087

lbiasco-sie opened this issue May 16, 2024 · 3 comments

Comments

@lbiasco-sie
Copy link

Description of Issue

A hang can occur in particular uses of USD with the Python threading library. I debugged it a bit and narrowed my particular case down to the UsdSchemaRegistry singleton's initialization, and it can be worked around by pre-initializing the registry before starting the threads.

That said, I wouldn't be surprised if this was a more pervasive issue with other singletons or atomic C++ operations.

Steps to Reproduce

  1. Unzip python_threading_hang_repro.zip and run python_threading_hang_repro.py.
  2. Uncomment the registry initializiation (line 16) to not hit the hang.

System Information (OS, Hardware)

Windows 11

Package Versions

USD-24.05

@jesschimein
Copy link
Contributor

Filed as internal issue #USD-9679

@spiffmon
Copy link
Member

That's weird, @lbiasco-sie - I'm not that familiar with python's threading library, but I'm really curious why we wouldn't run into this when multi-threading in C++. In any case, we'll have a look, and thanks for the repro.

@lbiasco-sie
Copy link
Author

I'm also curious about that. I forgot to mention this in the issue description but I tested the same underlying functions with a simple C++ script, and like you said it worked fine.

pixar-oss pushed a commit that referenced this issue Jun 11, 2024
See #3087

(Internal change: 2329966)
(Internal change: 2330383)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants