0

I have a program that spawns multiple child processes, how would I make the program only call atexit.register(function) on the main process and not on the child processes as well?

Thanks

ThatsNotMyName
  • 572
  • 2
  • 8
  • 24

1 Answers1

1

The functions registered via atexit are inherited by the children processes.

The simplest way to prevent that, is via calling atexit after you have spawned the children processes.

noxdafox
  • 14,439
  • 4
  • 33
  • 45