<story><title>JavaScript Concurrency Model and Event Loop</title><url>https://developer.mozilla.org/en/docs/Web/JavaScript/EventLoop</url></story><parent_chain></parent_chain><comment><author>twic</author><text>One thing this doesn&amp;#x27;t touch on is the different handling of microtasks and macrotasks:&lt;p&gt;&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;jakearchibald.com&amp;#x2F;2015&amp;#x2F;tasks-microtasks-queues-and-schedules&amp;#x2F;&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;jakearchibald.com&amp;#x2F;2015&amp;#x2F;tasks-microtasks-queues-and-s...&lt;/a&gt;&lt;p&gt;&lt;a href=&quot;http:&amp;#x2F;&amp;#x2F;www.c-sharpcorner.com&amp;#x2F;article&amp;#x2F;overview-of-micro-tasks-in-knockoutjs&amp;#x2F;&quot; rel=&quot;nofollow&quot;&gt;http:&amp;#x2F;&amp;#x2F;www.c-sharpcorner.com&amp;#x2F;article&amp;#x2F;overview-of-micro-tasks...&lt;/a&gt;</text></comment>
<story><title>JavaScript Concurrency Model and Event Loop</title><url>https://developer.mozilla.org/en/docs/Web/JavaScript/EventLoop</url></story><parent_chain></parent_chain><comment><author>bsaul</author><text>Side topic :&lt;p&gt;The event loop architecture is also heavily used in iOS &amp;#x2F; Cocoa, although it is often not well understood by developper. Each thread has an event loop, including the main UI thread, and many weird behaviors can be understood better once you know a bit about them.&lt;p&gt;Which made me wonder if a simple implementation of agent based concurrency in swift server couldn&amp;#x27;t simply be one agent - one event loop, plus a way to prevent direct calls across agent boundaries. Server is not iOS, but i suppose some language facilities should already be there and make it easier to implement.&lt;p&gt;&amp;#x2F;side topic</text></comment>