Design and implement a queue from scratch using basic arrays or linked lists, discussing thread-safety considerations.