In any multithreaded application, that has one writer thread and one reader thread, Do we need to use lockers ? For example:
public void example::increase() {
counter++;
}
public int example::getValue() {
return counter;
}
- In this example, Do we need lockers ?
- The app can crash if we will not use lockers ?
Thanks