Terminating multiple processes – SOLVED

Russel Winder russel at winder.org.uk
Mon Feb 5 16:27:25 UTC 2018


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20180205/ebaed788/attachment.sig>


More information about the Digitalmars-d-learn mailing list