rewrite glxplay with two threads