{"id":2156,"date":"2011-08-04T00:55:29","date_gmt":"2011-08-03T14:55:29","guid":{"rendered":"http:\/\/www.vectorstorm.org\/?p=2156"},"modified":"2011-08-04T00:55:29","modified_gmt":"2011-08-03T14:55:29","slug":"multithreading","status":"publish","type":"post","link":"https:\/\/www.vectorstorm.com.au\/2011\/08\/04\/multithreading\/","title":{"rendered":"Multithreading"},"content":{"rendered":"
Just a couple quick notes today, because I really ought to be sleeping instead of posting.<\/p>\n
Today, MMORPG Tycoon 2 has finally become a multithreaded game. \u00a0It’s not ubiquitous by any means, but it’s taken the first step; \u00a0the ground clutter is now being generated in a background thread. \u00a0The only bit of clutter-related code which is now occurring in the main thread is copying the final geometry into the buffer that OpenGL renders from. \u00a0Now all the setup work as you move around the map is being handled in separate threads.<\/p>\n
This means a couple of things. \u00a0For one, it means that MMORPG Tycoon 2 can finally use a little more of the CPU time from everyone with a multi-core computer (which is just about everyone with a computer from the last six years or so), and it also means that as more tasks can be moved out into other threads, I’ll be able to do more and more processing without hurting the game’s frame rate.<\/p>\n
I’ll also note that Mac OS X’s support for semaphores is half-broken, and Win32’s support for semaphores is bizarre and generally unrelated to traditional semaphores. \u00a0Makes me a sad coder. \u00a0(for the non-coders in the audience: \u00a0semaphores are a tool for synchronising multiple threads, to help keep them from stepping on each other’s toes)<\/p>\n
More details tomorrow. \u00a0Or later today, I guess, technically. \u00a0And semaphores will eventually be ported back into the VectorStorm trunk, if anyone wants to look at them. \u00a0Also fixed some bugs in the vsTask class, and added features to the vsMutex. \u00a0Will need to move all those changes back to the live trunk in the near future. \u00a0Maybe over the weekend.<\/p>\n","protected":false},"excerpt":{"rendered":"
Just a couple quick notes today, because I really ought to be sleeping instead of posting. Today, MMORPG Tycoon 2 has finally become a multithreaded game. \u00a0It’s not ubiquitous by any means, but it’s taken the first step; \u00a0the ground clutter is now being generated in a background thread. \u00a0The only bit of clutter-related code…<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":""},"categories":[4,24,25,3],"tags":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/po9WK-yM","_links":{"self":[{"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/posts\/2156"}],"collection":[{"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/comments?post=2156"}],"version-history":[{"count":0,"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/posts\/2156\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/media?parent=2156"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/categories?post=2156"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/tags?post=2156"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}