threads creation in linux for lottery scheduling