Applied Materials Interview Question

1. Implement a thread safe queue. 2. Given a 8 bit image / matrix and a threshold, implement a function which return an image where all numbers above threshold are 255 and below are 0 in the smallest complexity.