Updated Python threading prototype