Suppose you use a ThreadPool
to perform some operations and assume that each operation writes on a file. All threads of ThreadPool
are background threads, so they will be terminated when closing the application. What happens if the application is closed while a thread of ThreadPool
is writing a file to disk?
Operating system will close the file handle as the part of terminating the process.