Microsoft Interview Question

Solve integral image Defending shared resources among threads