Multithread programming library