With a few exceptions, MCUs are single-core systems. Multitasking is not something that is generally done; instead, there's a single thread of execution with timers and interrupts adding asynchronous methods of operation.
Atomic operations are generally supported by compilers and AVR is no exception. The need for atomic blocks of instructions can be seen in the following cases. Keep in mind that while a few exceptions exist (MOVW to copy a register pair and indirect addressing via X, Y, Z pointers), instructions on an 8 bit architecture generally only affect 8 bit values.
- A 16 bit variable is byte-wise read in the main function and updated in an ISR.
- A 32 bit variable is read, modified and subsequently stored back in either main function or ISR while the other routine could try to access it.
- The execution of a block of code is time-critical (bitbanging I/O, disabling...