<?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>suspend and resume of threads in Multi threading</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/111472/suspend-and-resume-of-threads-in-multi-threading</link><description>I am using four threads in a application which are main(priority 0), sensor read(priority 6), BLE notify sender(priority 6), ideal thread(priority 15). sensor and BLE notify sender thread have same priority so they are running in co-operative scheduling</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 03 Jun 2024 07:37:39 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/111472/suspend-and-resume-of-threads-in-multi-threading" /><item><title>RE: suspend and resume of threads in Multi threading</title><link>https://devzone.nordicsemi.com/thread/487042?ContentTypeID=1</link><pubDate>Mon, 03 Jun 2024 07:37:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dd47446f-19bd-4b65-b226-c18cf22609a9</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi Karthik,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Glad to hear that you found a solution to your problem. Hope you have a wonderful day!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: suspend and resume of threads in Multi threading</title><link>https://devzone.nordicsemi.com/thread/486995?ContentTypeID=1</link><pubDate>Sun, 02 Jun 2024 16:24:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:228d6ab3-e13a-4475-b060-6eadd0abed08</guid><dc:creator>Karthik p</dc:creator><description>&lt;p&gt;thanks&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I have switched to using &lt;/span&gt;&lt;code&gt;k_thread_create()&lt;/code&gt;&lt;span&gt; instead of the &lt;/span&gt;&lt;code&gt;K_THREAD_DEFINE&lt;/code&gt;&lt;span&gt; macro to create threads. This allows me to suspend the threads based on the notify status.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;BR,&lt;/p&gt;
&lt;p&gt;Karthik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: suspend and resume of threads in Multi threading</title><link>https://devzone.nordicsemi.com/thread/485812?ContentTypeID=1</link><pubDate>Fri, 24 May 2024 12:21:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8631f7d9-4c7e-4505-8efc-b5a4e46ad107</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Ok, so FIFO is filled up, then the BLE thread should start sending. What you can do is to&amp;nbsp;use a &lt;a href="https://docs.zephyrproject.org/latest/kernel/services/synchronization/semaphores.html"&gt;semaphore&lt;/a&gt; (in the FIFO thread) that&amp;nbsp;is given when when BLE thread is finished, for instance?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: suspend and resume of threads in Multi threading</title><link>https://devzone.nordicsemi.com/thread/485804?ContentTypeID=1</link><pubDate>Fri, 24 May 2024 12:04:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ee1e45f7-cf2d-4e61-b4bb-73abd3aa7a8d</guid><dc:creator>Karthik p</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;sensor FIFO takes 800ms to fill up so at that time&amp;nbsp; I wanted to run the BLE thread to transmit FIFO data to central that I am able to achieve making these two thread run in co-operative thread.&lt;/p&gt;
&lt;p&gt;I want add more function to this when the notify disable I wanted to suspend the sensor thread so it stop filling FIFO and ideal thread can be run on that time.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Is it possible suspend both BLE thread and sensor thread and resume some who detecting the notify enable&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;BR&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Karthik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: suspend and resume of threads in Multi threading</title><link>https://devzone.nordicsemi.com/thread/485792?ContentTypeID=1</link><pubDate>Fri, 24 May 2024 11:25:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:51538f35-3066-4db5-a541-6f9b1a9f6b2e</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You can suspend and resume a thread like described in the documentation:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://docs.zephyrproject.org/latest/kernel/services/threads/index.html#thread-suspension"&gt;https://docs.zephyrproject.org/latest/kernel/services/threads/index.html#thread-suspension&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;However, it does sound like your problem is something else. Can you please elaborate on what is happening in your application?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>