Two progressive missions using the KASA Python Runtime.
Two threads perform read β modify β write on the same value.
Watch both threads read the same value before either writes. One update can be lost.
Multiple threads can interleave this logical operation and overwrite each other's result.
Only one thread enters the protected region at a time.
threading.Lock and a with lock: critical section. Keep the lock scope as small as practical.queue.Queue can be a cleaner coordination primitive than manually sharing a list or counter.Complete the TODOs. Target: Expected = 200 and Actual = 200.