pcp
[Top] [All Lists]

Async events (was Re: [pcp] pmServiceDiscoveryInterrupt() commit a8b87e2

To: Dave Brolley <brolley@xxxxxxxxxx>
Subject: Async events (was Re: [pcp] pmServiceDiscoveryInterrupt() commit a8b87e2 et al.)
From: Nathan Scott <nathans@xxxxxxxxxx>
Date: Mon, 14 Jul 2014 00:02:39 -0400 (EDT)
Cc: pcp@xxxxxxxxxxx
Delivered-to: pcp@xxxxxxxxxxx
In-reply-to: <167962287.9276874.1405309225214.JavaMail.zimbra@xxxxxxxxxx>
References: <20140619194444.3B03D58015@xxxxxxxx> <y0mpphe60bw.fsf@xxxxxxxx> <53BD8921.3000306@xxxxxxxxxx> <2109477330.6980142.1404945968324.JavaMail.zimbra@xxxxxxxxxx> <53BE9F30.7010106@xxxxxxxxxx> <1543911711.7865026.1405028479709.JavaMail.zimbra@xxxxxxxxxx> <53C03CCF.3000908@xxxxxxxxxx> <167962287.9276874.1405309225214.JavaMail.zimbra@xxxxxxxxxx>
Reply-to: Nathan Scott <nathans@xxxxxxxxxx>
Thread-index: ShRQ6Vrflfl2jRrFCNmGgkKCBKZjU7KeX3rf
Thread-topic: pmServiceDiscoveryInterrupt() commit a8b87e2 et al.
Hi Dave,

Oh forgot to mention this...

----- Original Message -----
> ----- Original Message -----
> > On 07/10/2014 05:41 PM, Nathan Scott wrote:
> > > Hmmm, OK.  The only other suggestion then would be to make it a more
> > > general, and call it "flags" (where flags can go in/out of the API).
> > > But thats a pretty ordinary approach too, really.
> > >
> > > Oh, or could interrupted-ness be indicated via the return code?
> > No, the interrupted flag is intended to be set from the calling app in
> > after calling the service discovery API (via signal handler, another
> > thread, or some similar means) in order to interrupt the process.
> 
> Mmm, fruity.  A temporarily-replaced signal handler for the duration of
> the call mighta been another alternative, allowing an interface similar
> to syscall interruption (with EINTR-style return) - but, as I said...

See src/libpcp/src/AF.c btw - provides one, cross-platform model you might
consider for:

> > [...] temporarily disable the -t or --timeout option pending a proper
> > re-implementation.

(pmlogger uses that stuff extensively, for example)

cheers.

--
Nathan

<Prev in Thread] Current Thread [Next in Thread>