<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://homeostasis.scs.carleton.ca/wiki/index.php?action=history&amp;feed=atom&amp;title=Game_Engines_2021W_Lecture_6</id>
	<title>Game Engines 2021W Lecture 6 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://homeostasis.scs.carleton.ca/wiki/index.php?action=history&amp;feed=atom&amp;title=Game_Engines_2021W_Lecture_6"/>
	<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Game_Engines_2021W_Lecture_6&amp;action=history"/>
	<updated>2026-04-08T03:15:38Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.42.1</generator>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Game_Engines_2021W_Lecture_6&amp;diff=22885&amp;oldid=prev</id>
		<title>Soma: Created page with &quot;==Notes==  &lt;pre&gt; Lecture 6 ---------  comments on journal Show &amp; Tell concurrency in game engines &amp; godot using gdb with godot (to debug the engine)  Journal comments  - many...&quot;</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Game_Engines_2021W_Lecture_6&amp;diff=22885&amp;oldid=prev"/>
		<updated>2021-01-28T22:53:57Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;==Notes==  &amp;lt;pre&amp;gt; Lecture 6 ---------  comments on journal Show &amp;amp; Tell concurrency in game engines &amp;amp; godot using gdb with godot (to debug the engine)  Journal comments  - many...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Notes==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Lecture 6&lt;br /&gt;
---------&lt;br /&gt;
&lt;br /&gt;
comments on journal&lt;br /&gt;
Show &amp;amp; Tell&lt;br /&gt;
concurrency in game engines &amp;amp; godot&lt;br /&gt;
using gdb with godot (to debug the engine)&lt;br /&gt;
&lt;br /&gt;
Journal comments&lt;br /&gt;
 - many of you are making good progress&lt;br /&gt;
 - but many of you seem to be very undecided in terms of project directions&lt;br /&gt;
 - many seem a bit ambitious&lt;br /&gt;
&lt;br /&gt;
It is important to really understand what you want to do, but you&lt;br /&gt;
need to have reasonable goals&lt;br /&gt;
&lt;br /&gt;
Strategy: work on a piece of a grand vision&lt;br /&gt;
 - key differentiation&lt;br /&gt;
 - technically interesting&lt;br /&gt;
May not be too fun on its own&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Concurrency&lt;br /&gt;
 - notice we saw that godot has lots of threads running&lt;br /&gt;
   - we need them to use multiple cores&lt;br /&gt;
 - but threads make life very difficult, because concurrency&lt;br /&gt;
&lt;br /&gt;
with lots of transistors, we get many cores&lt;br /&gt;
&lt;br /&gt;
can be general purpose (CPU) or special purpose (GPU, tensor cores, etc)&lt;br /&gt;
&lt;br /&gt;
most of the special computational units are SIMD-ish&lt;br /&gt;
 - single instruction, multiple data&lt;br /&gt;
 - so, inherently parallel&lt;br /&gt;
&lt;br /&gt;
Some tasks are more straighforward to parallelize&lt;br /&gt;
 - rasterization of 3D graphics&lt;br /&gt;
&lt;br /&gt;
Other tasks aren&amp;#039;t&lt;br /&gt;
 - game AI, game logic&lt;br /&gt;
&lt;br /&gt;
So, what do we do with all the cores?&lt;br /&gt;
 - how do we coordinate activity?&lt;br /&gt;
&lt;br /&gt;
well, why not just have different threads work on shared data?&lt;br /&gt;
 - race conditions will lead to non-deterministic bugs&lt;br /&gt;
&lt;br /&gt;
We can solve race conditions with locks&lt;br /&gt;
 - when a thread accesses a data structure, it &amp;quot;locks&amp;quot; it, and only unlocks&lt;br /&gt;
   it when done&lt;br /&gt;
 - this is mutexes, semaphores, etc&lt;br /&gt;
   - you can&amp;#039;t just use regular variables to do synchronization &amp;amp; locking&lt;br /&gt;
 - BUT YOU DON&amp;#039;T WANT TO DO THIS&lt;br /&gt;
&lt;br /&gt;
You want a mutithreaded-friendly architecture, not mechanisms&lt;br /&gt;
 - otherwise, uncontrolled parallelism actually leads to slower code&lt;br /&gt;
   - or it will be buggy&lt;br /&gt;
&lt;br /&gt;
Godot is very smart about multithreading&lt;br /&gt;
  https://godotengine.org/article/why-does-godot-use-servers-and-rids&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Basically, servers are how you run a thread&lt;br /&gt;
 - a server has a particular set of functionality&lt;br /&gt;
&lt;br /&gt;
Servers interact via messages&lt;br /&gt;
&lt;br /&gt;
Shared data is possible, but it has a clear thread (server) owner, and is shared&lt;br /&gt;
via special references (RIDs), where, I think, access is by default read only&lt;br /&gt;
&lt;br /&gt;
Note that you don&amp;#039;t have to think about multithreaded code in Godot most of the time, but you should be aware&lt;br /&gt;
 - don&amp;#039;t expect variables to be instantly shared across nodes&lt;br /&gt;
 - instead, use messages (signals) to communicate changes in state&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Soma</name></author>
	</entry>
</feed>