# Which FreeRTOS Function To Use?

**URL:** <https://forums.freertos.org/t/which-freertos-function-to-use/4034>\
**Category:** Kernel\
**Created:** [March 11, 2013, 4:00pm UTC](https://forums.freertos.org/t/which-freertos-function-to-use/4034 "2013-03-11T16:00:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [March 11, 2013, 4:00pm UTC](https://forums.freertos.org/t/which-freertos-function-to-use/4034/1 "2013-03-11T16:00:41Z")

</div>

**[groufosse](https://sourceforge.net/u/groufosse/)** wrote on [Monday, March 11, 2013](https://sourceforge.net/p/freertos/discussion/382005/thread/b0f22c5d/#f676):

Hi,  
After reading throught the FreeRTOS “A Guide…”&nbsp; I’m still unsure just the right way to implement what I’m needing to do, and hoping for some advice. It’s fairly straightforward:

Task 1 runs every 30 seconds.  
When Task 2 runs, I need to suspend just Task 1 (no other task) until Task 2 is complete.

What’s the best way to do this?

Thank you for any tips on implementing this.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [March 11, 2013, 4:02pm UTC](https://forums.freertos.org/t/which-freertos-function-to-use/4034/2 "2013-03-11T16:02:33Z")

</div>

**[groufosse](https://sourceforge.net/u/groufosse/)** wrote on [Monday, March 11, 2013](https://sourceforge.net/p/freertos/discussion/382005/thread/b0f22c5d/#2302):

BTW - I should have noted that Task 2 runs non-scheduled (non-deterministic)

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [March 11, 2013, 4:26pm UTC](https://forums.freertos.org/t/which-freertos-function-to-use/4034/3 "2013-03-11T16:26:46Z")

</div>

**[friedl](https://sourceforge.net/u/friedl/)** wrote on [Monday, March 11, 2013](https://sourceforge.net/p/freertos/discussion/382005/thread/b0f22c5d/#c449):

If task 1 can be suspended at any time, then just  
assign task 2 a higher priority and it will suspend  
task 1 every time it runs.

---

<div class="post-metadata">

**Author:** ![richard-damon](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/richard-damon/32/38_2.png) [@richard-damon](https://forums.freertos.org/u/richard-damon)\
**Post date:** [March 12, 2013, 4:15am UTC](https://forums.freertos.org/t/which-freertos-function-to-use/4034/4 "2013-03-12T04:15:11Z")

</div>

**[richard\_damon](https://sourceforge.net/u/richard_damon/)** wrote on [Tuesday, March 12, 2013](https://sourceforge.net/p/freertos/discussion/382005/thread/b0f22c5d/#c246):

It isn’t totally clear what you mean, as, has been commented, if Task 2 has a higher priority than Task 1, then when ever task 2 is running task 1 is not (since FreeRTOS doesn’t to my knowledge support multi-core processors). If what you mean is that every time you create a copy of Task2 with vTaskCreate or signal a semaphore/queue that Task2 is waiting on, you want Task 1 suspended until Task2 gets ready to end/block again, then use vTaskSuspend/Resume in Task2, with Task 1 as the target.
