EXCEPTION_ACCESS_VIOLATION at GLFW.glfwDestroyWindow()

Started by awesomelemonade, November 24, 2014, 22:33:45

Previous topic - Next topic

spasi

Also see the documentation of GLFW functions, most of them require that you only call them from the main thread.

In general, if you find yourself using new Thread() { ... }.start() or any kind of old-school thread synchronization (the synchronized keyboard, wait(), notify(), etc), you're most likely going to end up with concurrency bugs and sub-optimal performance. When you do identify parts of your program that would benefit from concurrency, focus on using existing JDK APIs, like Executors and the ForkJoinPool. When you do have to use threads explicitly, focus on message passing (using queues/actors/etc) between threads, instead of shared memory. And if you're feeling adventurous, try exotic but proven solutions like fibers/coroutines instead of custom multi-threaded code.

Concurrency is hard to get right (correct results & no deadlocks) and hard to scale properly (good performance with more CPU cores).