# Global Variable getting corrupt between Tasks

**URL:** <https://forums.freertos.org/t/global-variable-getting-corrupt-between-tasks/2302>\
**Category:** Kernel\
**Created:** [November 24, 2008, 10:35am UTC](https://forums.freertos.org/t/global-variable-getting-corrupt-between-tasks/2302 "2008-11-24T10:35:10Z")\
**Posts on this page:** 2\
**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:** [November 24, 2008, 10:35am UTC](https://forums.freertos.org/t/global-variable-getting-corrupt-between-tasks/2302/1 "2008-11-24T10:35:10Z")

</div>

**[sachindbhujbal](https://sourceforge.net/u/sachindbhujbal/)** wrote on [Monday, November 24, 2008](https://sourceforge.net/p/freertos/discussion/382005/thread/629e4a5d/#6033):

Dear All,  
&nbsp;&nbsp;&nbsp; I have declared a global variable which is upadted in one task, say TaskA & checking that variable in another task, say TaskB.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [November 24, 2008, 11:08am UTC](https://forums.freertos.org/t/global-variable-getting-corrupt-between-tasks/2302/2 "2008-11-24T11:08:16Z")

</div>

**[rnowotny](https://sourceforge.net/u/rnowotny/)** wrote on [Monday, November 24, 2008](https://sourceforge.net/p/freertos/discussion/382005/thread/629e4a5d/#6033/0fa2):

You need to declare static volatile  
Yours sincerely Robert
