merge minsik's thread code
fairness test program