python (12.9k questions)
javascript (9.2k questions)
reactjs (4.7k questions)
java (4.2k questions)
java (4.2k questions)
c# (3.5k questions)
c# (3.5k questions)
html (3.3k questions)
Prevent consecutive read operations from memory in C from being optimized away
My goal is to iterate memory on a microcontroller in C, and do two consecutive read operations on each cell, testing if both are zero. I try to do this as follows:
volatile uint8_t* memory = MEMORY_ST...
Cramstyler
Votes: 0
Answers: 0
is volatile HashMap enough for single writer multiple readers in java?
only one thread will call reload() at a time.
I want to ensure that at any time, callers of get will see the content of the same latest map
instance.
Pardon me for my vague descrition on requirement.
...

Chen Li
Votes: 0
Answers: 4
How to remove unnecessary caching of a variable?
A simple example.
A class with a method creating a task and a flag for exiting the loop:
using System.Threading.Tasks;
namespace Examp
{
public class CancelFlag
{
public bool Flag;
...

EldHasp
Votes: 0
Answers: 0
Avoid volatile bit-field assignment expression reading or writing memory several times
I want to use volatile bit-field struct to set hardware register like following code
union foo {
uint32_t value;
struct {
uint32_t x : 1;
uint32_t y : 3;
uint32_t z : 2...
old cat
Votes: 0
Answers: 3