works for all thread number. seems to be error free. performance is mediocre