Wizardry with c strings, pthread magic to make this compile