Comments (4)
Same effect can be achieved with the following Python code:
# mymod.py
import nanogui as ng
ng.init()
s = ng.Screen(ng.Vector2i(1200,800), "Test")
s.drawAll()
s.setVisible(True)
h = ng.mainloop(detach = s)
Then import mymod
causes the same problem as the C++ code above.
from nanogui.
I get
% python2.7
Python 2.7.10 (default, Oct 23 2015, 19:19:21)
[GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import mymod
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
RuntimeError: not holding the import lock
>>>
Apparently a thread that imports a Python module must also hold a special import lock. This of course wreaks havoc when switching threads beneath Python.
http://stackoverflow.com/questions/4754319/what-is-import-lock-in-python
http://bugs.python.org/issue18122
I think this is a bit too weird of an issue to consider a pybind11/nanogui bug.
from nanogui.
(The solution is to import your module, and to postpone the mainloop call to a method that is invoked following the import.)
from nanogui.
Actually, it seems to also be some weird interaction with IPython. In plain Python, I also get "not holding import lock", but actually everything seems to function fine. In IPython, I don't get the RuntimeError, but I do get the hanging behavior.
Python has some weird quirks. But I agree with you, it's not worth considering a pybind11/nanogui bug.
from nanogui.
Related Issues (20)
- about the relationship between objects HOT 1
- std::cerr confusion
- Custom Font Problem (and possibly outdated documentation)
- Can't find nanogui_resources.h HOT 1
- msvc and vcpkg static build compiles, but runtime fails without nanogui.dll
- I want to draw some points in GLCanvas
- Identifier 'gluniform1i' is not defined HOT 2
- cmake error in clion HOT 1
- colorwheel.cpp.obj: too many sections (32966) or colorwheel.cpp.obj: File too big
- Hi! I'm looking for examples of 'stretchy' gui design!?
- How to avoid using 3rdparty libraries under ext, but using system installed libraries?
- TextBox - box is not wide enough for the string value argument HOT 1
- How to include Custom Fonts? HOT 2
- Multiple nanogui::screen HOT 2
- On the issue of window size. HOT 1
- Failed to build on MSYS2 MINGW64 HOT 1
- Preventing blocking during shell interactions
- May I know how to make the textbox support Chinese input? HOT 1
- How to complie with emscripten
- Input in multiple screens
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nanogui.