Best way to obtain indexed access to a Python queue, thread-safe Best way to obtain indexed access to a Python queue, thread-safe multithreading multithreading