After struggles with threads, a compromise.