# Semaphore

**URL:** <https://verificationacademy.com/forums/t/semaphore/39253>\
**Category:** SystemVerilog\
**Tags:** SystemVerilog\
**Created:** [July 1, 2021, 12:53am UTC](https://verificationacademy.com/forums/t/semaphore/39253 "2021-07-01T00:53:05Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![Rsignori92](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/r/3da27b/32.png) [@Rsignori92](https://verificationacademy.com/forums/u/Rsignori92)\
**Post date:** [July 2, 2021, 8:23am UTC](https://verificationacademy.com/forums/t/semaphore/39253/7 "2021-07-02T08:23:13Z")

</div>

_In reply to [timag](https://verificationacademy.com/forums/t/semaphore/39253/6):_

Hello all, Why not simply declaring those pop and push function as tasks? Having a function that does it for you could cause issues due to the 0 delay execution which is dangerous in case of loops. Is there amy restrictions in using function instead of task ?.

Trying to call try\_get and try\_put i believe could cause some clashes since a 0 delay function could be executed before another in a not known manner i believe. Regards

---

_[View the full topic](https://verificationacademy.com/forums/t/semaphore/39253)._
