LLD - Design — Parking Lot System
Given the following pseudocode where two threads increment a shared variable
If
count without synchronization:Thread 1: temp = count
temp = temp + 1
count = temp
Thread 2: temp = count
temp = temp + 1
count = tempIf
count starts at 0, what is a possible final value after both threads execute once?