On Thursday, 1 February 2018 at 11:42:32 UTC, Russel Winder wrote:
On Wed, 2018-01-31 at 22:15 +0000, Arek via Digitalmars-d-learn
wrote:
[…]
The problem is actually a thread blocked in an inotify blocking
read. As both Steven and yourself have pointed out I am going
to have to use a timeout to check the state of the application.
Try to use inotify in non-blocking mode (an example here:
https://gist.github.com/pkrnjevic/6016356) with select or epoll
and timeouts.
I guess there is a choice here between shared memory to set the
termination flag, or using an input channel and sending the
termination message. I think the latter may be preferable, and
certainly more consistent with how the other threads terminate.
I would use shared memory here (eg. atomic bool) because any
communication channel introduces possibility of further blocking
problems.
Arek