How to terminate correctly program?

Alexander Tormasov a.tormasov at innopolis.ru
Mon Jan 6 13:19:15 CET 2020


I try to finish a program with a lot of threads (eg 6). In particular, it call libc exit(0) from one of them.

Then seems that it start to free memory , and one of threads accidentally receive timer event, and try to access its own memory - and fail because it already became inaccessible.

Unfortunately I do not have normal control over it (this is just a behavior of golang “hello world” program!)

Can I forcible cancel all timers/signals inside program threads and stop all activities to avoid such problems? Better without races ;)

Sincerely,
   Alexander



More information about the users mailing list