资源:适用于OpenGL实时应用程序的Java并行性 [英] Resources: Parallelism in Java for OpenGL realtime applications

查看:112
本文介绍了资源:适用于OpenGL实时应用程序的Java并行性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近参加了一次关于并行性的好处的演讲,这对于为实时3d图形应用程序更有效地利用多核处理器的功能而言.该讨论是关于C ++和TBB(线程构建块)(英特尔)的.我已经了解了Java 7中的Fork/Join,但是我想了解更多有关通过OpenGL/JOGL运行实时3d图形的信息.

I recently went to a lecture on the benefits of Parallelism in regards to tapping the power of multicore processors more efficiently for real time 3d graphics applications. This discussion was about C++ and TBB (Threading Building Blocks) (Intel). I have found out about Fork/Join in Java 7 but I would like to learn more about running realtime 3d graphics through OpenGL / JOGL.

我听说OpenGL/JOGL必须存在于一个线程中.我不知道这是否是真的.如果您具有Java并行/多核编程方面的实时图形应用程序经验,并且可以为我提供一些很棒的资源.

I have heard that OpenGL/JOGL must exist in one thread. I do not know if this is true. If you have experience with Parallelism / Multicore programming in Java in regards to real time graphic applications and could point me towards some resources that would be fantastic.

推荐答案

Is JOGL restricted to one thread?

否,JOGL本身未绑定到一个线程.只有AWT GLCanvas是.后者是其GLAutoDrawable实现之一. AWT GLCanvas受AWT本身的限制,在AWT EDT上需要对本机资源进行操作才能运行.

No, JOGL itself is not bound to one thread. Only AWT GLCanvas is. The latter is one of its GLAutoDrawable implementations. AWT GLCanvas is restricted due to AWT itself, where manipulation of native resources are required to run on the AWT EDT.

How to work with JOGL lock free?

要完全免费使用锁,可以使用 NEWT . NEWT允许您从多个线程渲染多个窗口, 他们不会互相阻塞..干扰等 同样,NEWT事件处理也不会干扰渲染.

To work 'almost' lock free, you can use NEWT. NEWT allows you to render multiple windows from multiple threads, while they don't block each other .. interfere, etc. Also NEWT event handling will not interfere w/ rendering.

Example of multithreading use

OpenGL多线程使用的另一个示例(是否带有JOGL) 是通过专用的纹理来填充纹理或其他与GL相关的资源 线程持有共享的屏幕外OpenGL上下文[带有屏幕上下文]. 专用线程可以向渲染循环发出可用资源等信号. 看看我们的GLDrawableFactory中有很多可绘制的工厂 方法是公开的. Note: offscreen mode can be selected via the GLCapabilities.

Another example of multithreading use of OpenGL (w/ JOGL or not) is to fill textures or other GL related resources from a dedicated thread holding a shared offscreen OpenGL context [w/ the onscreen context]. The dedicated thread could signal the rendering loop available resources etc. Have a look in our GLDrawableFactory were plenty of drawable factory methods are public. Note: offscreen mode can be selected via the GLCapabilities.

You may like to browse through out unit tests in one of the

You may like to browse through out unit tests in one of thegit repos. Pls check class 'TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT' and shared OpenGL context tests include the name 'Shared'.

这篇关于资源:适用于OpenGL实时应用程序的Java并行性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆