On Fri, 2018-02-02 at 20:14 +0000, David Nadlinger wrote: > […] > That sounds entirely sensible. Your original question was whether it > was > possible to terminate threads blocked in a syscall, though. Signals > allow you to do that on POSIX for many "slow" syscalls, by making it > return EINTR. You would check whatever channel/atomic flag/… > mechanism > you use to signal termination before continuing to block by > reissuing > the syscall. > > I haven't tested how `read` behaves for inotify myself, but > inotify(7) > suggests that it indeed handles signals this way. […]
After some discussions, Dmitry acted very quickly and added a timeout read to the blocking read in dinotify. This solves my problem "at a stroke" as I can now block waiting for a specific time on inotify and then check the input channel for a time and repeat. Not really busy wait just a sequence of blocking reads with timeouts. The important thing is that With very little latency, the thread is checking two things. DInotify 0.3.0 will likely appear soon in Dub. It would be good to get it packaged for Debian. I will take up an invitation to submit a ready made package for the Debian D packaging team. -- Russel. =========================================== Dr Russel Winder t: +44 20 7585 2200 41 Buckmaster Road m: +44 7770 465 077 London SW11 1EN, UK w: www.russel.org.uk
signature.asc
Description: This is a digitally signed message part