# Handle Global Memory

**URL:** <https://forums.freertos.org/t/handle-global-memory/7697>\
**Category:** Kernel\
**Created:** [February 27, 2019, 5:47pm UTC](https://forums.freertos.org/t/handle-global-memory/7697 "2019-02-27T17:47:34Z")\
**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:** [February 27, 2019, 5:47pm UTC](https://forums.freertos.org/t/handle-global-memory/7697/1 "2019-02-27T17:47:34Z")

</div>

**[canalrun](https://sourceforge.net/u/canalrun/)** wrote on [Wednesday, February 27, 2019](https://sourceforge.net/p/freertos/discussion/382005/thread/1cf5d85eb9/#f8d4):

Hello,  
I am brand-new to Free RTOS. I have two questions.

1. I am using an Adafruit Feather ESP32 board purchased in Feb 2019 with the newest Arduino 1.8.8 IDE. I ran the simple examples from Random Nerd Tutorials and they worked using RTOS calls – so I guess I have it installed. Does this make sense? Do I have it installed? Or, am I fooling myself?

2. I plan to run two tasks on my ESP32. Core 0 will continually acquire ADC samples and store them in ping-pong buffers. Core 1 (within Loop()) will check a buffer position and/or full variable and perform FFT’s on the data. This requires a few global variables: the buffers, and the buffer position/full variables. Core 0 will be the only writer. Both core 0 and core 1 will read the variables.

Do global memory variables require mutexes or semaphores? The reads or writes will be atomic – either 16 or 32 bit integers.

Thanks,  
Barry.

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [February 27, 2019, 6:19pm UTC](https://forums.freertos.org/t/handle-global-memory/7697/2 "2019-02-27T18:19:15Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Wednesday, February 27, 2019](https://sourceforge.net/p/freertos/discussion/382005/thread/1cf5d85eb9/#f8d4/0136):

I have no idea about the platform or the software you are running on  
… but to answer your question: Generally if you have multiple  
readers but only one writer to a single value (rather than a structure)  
then you do not need a critical section provided the value can be  
written in one go (i.e. a 32-bit write on a 32-bit architecture can be  
written in one go, whereas a 64-bit value on a 32-bit architecture  
cannot). On the other hand if you have multiple writers then you would  
need a critical section.
