PSA: GLX is not thread safe, even if you use XLockDisplay()/XUnlockDisplay(). Xlib-XCB does not fix this. First Google result on this is a wrong Stack Overflow answer. GLX uses lots of per-process (not per-display) globals. You must use a process-wide lock around each GLX call.
No, that’s not true. Your first GLX call from multiple threads will call __glxInitialize unsynchronized and randomly crash. Check out https://github.com/pcwalton/surfman/commit/b8de64d30b7cd21c74545a98c3af6e30864c776e … and “cd surfman/surfman && cargo test”. Observe random failures.
-
-
The problem is that the internal “is GLX initialized?” check is unsynchronized and process-wide. If multiple threads race on that check, they will try to simultaneously initialize per-process GLX data and crash. Maybe if you initialize it manually beforehand it’s OK.
-
(1) What is your server setup and GL driver? (2) I will admit I have never tried to race the startup of multiple threads. That operation "feels" fraught with peril.
- 3 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.