Add threads to an existing program