{"author_name":"Ingon","cat":"LD #21","comments":[{"author_name":"SusanTheCat","time":"August 30, 2011 8:00 am","epoch":1314709200,"text":"Since I don&#8217;t mind looking stupid, what do you mean by STM?  I would assume some sort of thread management, but what does the S stand for?","spam":"N"},{"author_name":"SusanTheCat","time":"August 30, 2011 9:05 am","epoch":1314713100,"text":"Thanks for the link!","spam":"N"},{"author_name":"Felipe Budinich","time":"August 30, 2011 9:31 am","epoch":1314714660,"text":"Will read the link. The closer we have to multithreading (us lowly flash developers) is pixel bender :-p","spam":"N"}],"epoch":1314701700,"likes":2,"metadata":{"p_key":"63580","p_author":"Ingon","p_authorkey":"5130","p_urlkey":"99365","p_title":"STM in games","p_cat":"LD #21","p_event":"LD21","p_time":"1314701700","p_likes":"2","p_comments":"4","p_status":"UPD5","us_key":"5130","us_name":"Ingon","us_username":"ingon","event_start":"1313712000","event_key":"7","event_name":"LD21"},"text":"<p>I wander does anybody uses something like STM in games?<\/p>\n <p>I did try something like it in the last LD &#8211; my game used what I would call a lightweight STM. Meaning that had two threads of execution &#8211; a reader thread (which is actually performing the painting, based on a given game state) and a writer thread (which actually moves the game state ahead, the update loop).<\/p>\n <p>The writer threads starts a &#8220;transaction&#8221; and it is working with its private copy of the value. When commits, the value becomes visible to the reader\/painter thread.<\/p>\n <p>The main advantage of the approach is that we can use easy multi-threading (even utilize multiple cores) with clear separation between who makes updates and who makes the drawing on screen. The only negative I see is that we cannot use directly the values provided by the language but instead should wrap every peace of data in another layer\/abstraction.<\/p>\n <p>Any thoughts?<\/p>","time":"August 30th, 2011 5:55 am","title":"STM in games"}