Analogue of priority queue

I’m afraid not. You’ll need to protect access to the array by a mutex.

Steve