{"id":33,"date":"2009-06-29T19:21:03","date_gmt":"2009-06-30T02:21:03","guid":{"rendered":"http:\/\/blog.jausoft.com\/?p=33"},"modified":"2019-05-14T04:56:37","modified_gmt":"2019-05-14T08:56:37","slug":"jogl-newt-multiple-threads-windows","status":"publish","type":"post","link":"https:\/\/jausoft.com\/blog\/2009\/06\/29\/jogl-newt-multiple-threads-windows\/","title":{"rendered":"JOGL: Newt Multiple Threads &amp; Windows"},"content":{"rendered":"<p><!-- p, li { white-space: pre-wrap; } --><\/p>\n<p style=\"margin: 0px; text-indent: 0px;\">Newt is capable of handling multiple threads and windows.<\/p>\n<p style=\"margin: 0px; text-indent: 0px;\">For best compliance with the underlying OS, one shall create a window,<\/p>\n<p style=\"margin: 0px; text-indent: 0px;\">and handle it&#8217;s events within the same thread.<\/p>\n<p style=\"margin: 0px; text-indent: 0px;\"><!--more--><\/p>\n<p style=\"margin: 0px; text-indent: 0px;\">Below you see the invocation of the ES2 RedSquare <a href=\"https:\/\/jogl-demos.dev.java.net\/\" target=\"_blank\" rel=\"noopener noreferrer\">jogl-demos<\/a> utilizing multiple threads.<\/p>\n<p style=\"margin: 0px; text-indent: 0px;\">\n<p style=\"margin: 0px; text-indent: 0px;\">\n<p style=\"margin: 0px; text-indent: 0px;\">\n<ul>\n<li>Single thread (Unix, Win32)<br \/>\njava -Djava.awt.headless=true demos.es2.RedSquare -GL2<\/li>\n<\/ul>\n<p style=\"margin: 0px; text-indent: 0px;\">\n<p style=\"margin: 0px; text-indent: 0px;\">\n<p style=\"margin: 0px; text-indent: 0px;\">\n<ul>\n<li>Single thread (MacOSX)<br \/>\njava -XstartOnFirstThread -Djava.awt.headless=true demos.es2.RedSquare -GL2<\/li>\n<\/ul>\n<p style=\"margin: 0px; text-indent: 0px;\">\n<p style=\"margin: 0px; text-indent: 0px;\">\n<p style=\"margin: 0px; text-indent: 0px;\">\n<ul>\n<li>Multiple threads &amp; windows (Unix, Win32)<br \/>\njava -Djava.awt.headless=true demos.es2.RedSquare -GL2 -GL2 -GL2 -GL2<\/li>\n<\/ul>\n<p style=\"margin: 0px; text-indent: 0px;\">\n<p style=\"margin: 0px; text-indent: 0px;\">\n<p style=\"margin: 0px; text-indent: 0px;\">\n<ul>\n<li>Multiple threads &amp; windows (Unix, Win32)<br \/>\njava -XstartOnFirstThread -Djava.awt.headless=true com.sun.javafx.newt.util.MainThread demos.es2.RedSquare -GL2 -GL2 -GL2 -GL2<\/li>\n<\/ul>\n<p style=\"margin: 0px; text-indent: 0px;\">\n<p style=\"margin: 0px; text-indent: 0px;\">\n<p style=\"margin: 0px; text-indent: 0px;\">\n<p style=\"margin: 0px; text-indent: 0px;\">The serialization of the main Java class through <em>com.sun.javafx.newt.util.MainThread<\/em><\/p>\n<p style=\"margin: 0px; text-indent: 0px;\">may be used for all platforms, since it only takes effect on MacOSX.<\/p>\n<p style=\"margin: 0px; text-indent: 0px;\">This allows you an almost platform independent invocation of your multithreaded Java applications.<\/p>\n<p style=\"margin: 0px; text-indent: 0px;\">\n<p>On MacOSX, <em>com.sun.javafx.newt.util.MainThread<\/em> will occupy the main thread and<br \/>\nserializes all native window related tasks through it.<br \/>\nThis mechanism is thread safe utilizes reentrant locking.<\/p>\n<p style=\"margin: 0px; text-indent: 0px;\"><!--EndFragment--><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Newt is capable of handling multiple threads and windows. For best compliance with the underlying OS, one shall create a window, and handle it&#8217;s events within the same thread.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[7,3,8],"tags":[9,16,44,17],"class_list":["post-33","post","type-post","status-publish","format-standard","hentry","category-3d-opengl","category-computer-stuff","category-jogamp","tag-3d","tag-java","tag-jogamp","tag-opengl"],"_links":{"self":[{"href":"https:\/\/jausoft.com\/blog\/wp-json\/wp\/v2\/posts\/33","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jausoft.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jausoft.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jausoft.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/jausoft.com\/blog\/wp-json\/wp\/v2\/comments?post=33"}],"version-history":[{"count":1,"href":"https:\/\/jausoft.com\/blog\/wp-json\/wp\/v2\/posts\/33\/revisions"}],"predecessor-version":[{"id":597,"href":"https:\/\/jausoft.com\/blog\/wp-json\/wp\/v2\/posts\/33\/revisions\/597"}],"wp:attachment":[{"href":"https:\/\/jausoft.com\/blog\/wp-json\/wp\/v2\/media?parent=33"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jausoft.com\/blog\/wp-json\/wp\/v2\/categories?post=33"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jausoft.com\/blog\/wp-json\/wp\/v2\/tags?post=33"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}