# 1800'2017 9.3.2 Parallel blocks: Why Within a fork-join\_any it shall be illegal to refer to formal arguments passed by reference

**URL:** <https://verificationacademy.com/forums/t/18002017-9-3-2-parallel-blocks-why-within-a-fork-join-any-it-shall-be-illegal-to-refer-to-formal-arguments-passed-by-reference/37051>\
**Category:** SystemVerilog\
**Tags:** argument-pass-by-ref, SystemVerilog\
**Created:** [January 22, 2020, 12:14am UTC](https://verificationacademy.com/forums/t/18002017-9-3-2-parallel-blocks-why-within-a-fork-join-any-it-shall-be-illegal-to-refer-to-formal-arguments-passed-by-reference/37051 "2020-01-22T00:14:53Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![dave\_59](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/dave_59/32/4499_2.png) [@dave\_59](https://verificationacademy.com/forums/u/dave_59)\
**Post date:** [January 22, 2020, 1:26am UTC](https://verificationacademy.com/forums/t/18002017-9-3-2-parallel-blocks-why-within-a-fork-join-any-it-shall-be-illegal-to-refer-to-formal-arguments-passed-by-reference/37051/2 "2020-01-22T01:26:46Z")

</div>

_In reply to [ben@SystemVerilog.us](https://verificationacademy.com/forums/t/18002017-9-3-2-parallel-blocks-why-within-a-fork-join-any-it-shall-be-illegal-to-refer-to-formal-arguments-passed-by-reference/37051):_

Hi Ben,

The problem here is when you have a fork/join\_none/join\_any, you need to know the lifetime of the variables declared outside referenced from inside. SystemVerilog has to extend the lifetime of the variable to include the lifetime of the forked processes to make sure they are still valid at any point while process is still active. When you pass a variable by reference to a task or function, you lose that information because all you know is that you have a handle to an int type. The implementation of the task/function is written to be intenpendent of what gets passed to it.

In mot cases you can easily workaround this limitation as pass by references is rarely needed. In your example, you can replace **ref** with **inout** and still get the same functionality.

---

_[View the full topic](https://verificationacademy.com/forums/t/18002017-9-3-2-parallel-blocks-why-within-a-fork-join-any-it-shall-be-illegal-to-refer-to-formal-arguments-passed-by-reference/37051)._
