minor: use processes when possible, and threads only when neededotherwise