I was wondering if there are any potential problems with using code similar to below?
System.arraycopy(Global.queueUrgent, 1, Global.queueUrgent, 0, Global.queueUrgent.length-1);
I have an array which works as a job queue. Another thread looks at this queue and then acts on it according to the data held in Global.queueUrgent[0]. Once this task has been accomplished, the first job is removed and the rest of the queue is brought forward one (and hence the code sample).
I understand the risks of a race condition which might occur in my application and can prevent it as much as possible but I was wondering if there were any other concerns I should address. It's important that I use an array such as this for my project.
I haven't tried to implement the code as of yet as I would like to hear your thoughts on it first.
Regards,
Robert (1BillionHex).