<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>System design / thread communication</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/65886/system-design-thread-communication</link><description>Hello, 
 I am evaluating what the best way is to solve this problem: We have 2 network interfaces on our board. We would like to be able to switch between them dynamically. Many other threads need network functionality. 
 Idea: Have a networking thread</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 15 Sep 2020 06:56:45 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/65886/system-design-thread-communication" /><item><title>RE: System design / thread communication</title><link>https://devzone.nordicsemi.com/thread/269525?ContentTypeID=1</link><pubDate>Tue, 15 Sep 2020 06:56:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:41986515-8eb1-4681-b6bb-5fd3e0907da1</guid><dc:creator>newUser</dc:creator><description>&lt;p&gt;Hi Carl Richard,&lt;/p&gt;
&lt;p&gt;Thank you for the response and the nice suggestions. This definitely helped me on my way.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: System design / thread communication</title><link>https://devzone.nordicsemi.com/thread/269405?ContentTypeID=1</link><pubDate>Mon, 14 Sep 2020 13:43:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7e1efc95-3a89-4079-a8ca-e3df9940ef90</guid><dc:creator>Carl Richard</dc:creator><description>&lt;p&gt;Hello!&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Thank you for reaching out! The idea of a dedicated network manager thread is good and it sounds like you can make use of the Zephyr&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/include/event_manager.html"&gt;event manager&lt;/a&gt;.&amp;nbsp; This library enables easy propagation of events between different modules and threads. I&amp;#39;ve had good experiences using it! However, note that it is currently limited to 32 event types.&lt;br /&gt;&lt;br /&gt;If the event manager does not fit your needs I recommend taking a look at the NCS Asset Tracker example. The &amp;quot;network thread&amp;quot; (cloud thread) only communicates with main, but it&amp;#39;s a good demonstration on how event handlers can be used across threads. This application uses work queues, and is in that manner similar to your second alternative with internal FIFOs in each thread.&lt;br /&gt;&lt;br /&gt;Hope this helps you on your way!&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Carl Richard&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>