views:

16

answers:

1

I've written a tool that uses inotify watches to monitor directory changes. It starts a separate thread per watched directory, each using inotify to setup the watch.

What happens to these threads/watches if the parent process is terminated with kill?

+1  A: 

Since they belong to the same process, they will be cleaned up.

Aaron Digulla
Will the watches added to inotifty also be removed? What happens if it isn't?
slashmais
They will be cleaned as well. Generally, all resources are cleaned up unless the docs specifically say otherwise (semaphores would be an example).
Aaron Digulla