python threads with dependencies