I am not sure if this is a safe thing to do or not. (Pesky lack of documentation) I want to have 2 threads that work on 1 NSMutableArray. I am going to use the array like a queue. One thread reads and removes stuff from the front, the second thread adds to the end. I have already thought out how I am going to synchronize the addition and stuff so that if the thread removing stuff from the queue finds [queue count] == 0, then it will just wait for new data via a condition lock.
Do I need to use a lock when I remove something or add something from the NSMutableArray? I can think of an instance where, one thread is trying to remove the last item while another is trying to add something to the end of that item and everything could get messed up if it wasn't thread safe. So: Is NSMutableArray thread safe or will I need to use my own locks to control addition/ subtraction of stuff?