Can't you interrupt them (aka SIGSTOP) instead? Then you could resume them, instead of reopening them and potentially using state.