add thread class(come from http://tinythreadpp.bitsnbites.eu/);
add BitHacks(come from http://graphics.stanford.edu/~seander/bithacks.html);