# Using fork join\_none to span threads in a for loop in parallel, which is executed in forever loop

**URL:** <https://verificationacademy.com/forums/t/using-fork-join-none-to-span-threads-in-a-for-loop-in-parallel-which-is-executed-in-forever-loop/37927>\
**Category:** SystemVerilog\
**Tags:** SystemVerilog, for-loop-fork-join\_none, forever-loopfork-join\
**Created:** [August 9, 2020, 8:25pm UTC](https://verificationacademy.com/forums/t/using-fork-join-none-to-span-threads-in-a-for-loop-in-parallel-which-is-executed-in-forever-loop/37927 "2020-08-09T20:25:19Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![logie](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/l/74df32/32.png) [@logie](https://verificationacademy.com/forums/u/logie)\
**Post date:** [August 10, 2020, 12:30am UTC](https://verificationacademy.com/forums/t/using-fork-join-none-to-span-threads-in-a-for-loop-in-parallel-which-is-executed-in-forever-loop/37927/2 "2020-08-10T00:30:02Z")

</div>

_In reply to [VarshaAnand2402](https://verificationacademy.com/forums/t/using-fork-join-none-to-span-threads-in-a-for-loop-in-parallel-which-is-executed-in-forever-loop/37927):_

Your code is creating infinite number of threads… and each thread is trying to run  
monitor\_signal.

If you look at the logic, the for\_loop runs MAX\_EX\_PARAM times and creates monitor\_signal threads. After this it exits the for\_loop, jumps into the forever\_loop and reenters for\_loop  
This creates another MAX\_EX\_PARAM threads all running monitor\_signal.

---

_[View the full topic](https://verificationacademy.com/forums/t/using-fork-join-none-to-span-threads-in-a-for-loop-in-parallel-which-is-executed-in-forever-loop/37927)._
