Describe a concurrency question you encountered and how you approached it.
For this coding exercise, implement parallel_sum(nums, worker_count) using multiple threads and a thread-safe work queue. Return the sum of all integers, ensuring shared state is synchronized and the function handles empty input.
Input is an integer array and a positive worker count. Output is one integer containing the array sum.
def parallel_sum(nums, worker_count):