first vers of multithreaded queue