pcp
[Top] [All Lists]

Re: [pcp] pmRegisterDerived return values

To: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>
Subject: Re: [pcp] pmRegisterDerived return values
From: Nathan Scott <nathans@xxxxxxxxxx>
Date: Fri, 22 Jan 2016 04:48:24 -0500 (EST)
Cc: Marko Myllynen <myllynen@xxxxxxxxxx>, pcp developers <pcp@xxxxxxxxxxx>
Delivered-to: pcp@xxxxxxxxxxx
In-reply-to: <002a01d154f5$a7ec0a80$f7c41f80$@internode.on.net>
References: <569CB025.4070603@xxxxxxxxxx> <569CB7C5.7030803@xxxxxxxxxxxxxxxx> <1305297915.11201184.1453261568406.JavaMail.zimbra@xxxxxxxxxx> <006201d153e5$03a61fd0$0af25f70$@internode.on.net> <1320206202.12543073.1453421036522.JavaMail.zimbra@xxxxxxxxxx> <002a01d154f5$a7ec0a80$f7c41f80$@internode.on.net>
Reply-to: Nathan Scott <nathans@xxxxxxxxxx>
Thread-index: AQIHi+15HIXLtpebrkfAOJtsaFEj0AIkYFWzAnUHQ94BqJQe9gJHRgBlnlaH5QDJBmf5FA==
Thread-topic: pmRegisterDerived return values

----- Original Message -----
> > -----Original Message-----
> > 
> > Whaddyareckon?  It definitely resolves the bug - verified it with
> > extension to the existing python test cases.
> 
> What arbitrary rules does the python run time follow when switching threads?
> 
> As I understand the original issue, is there may still a problem if the
> thread that detects the error is not the same as the thread that tries to
> copy the message buffer before the return in the variant function?

My understanding is that calls down to a C API are effectively atomic
from the interpreters POV (which makes sense, since there's not really
any opportunity to intercede once a library call is made).

> That's why I was proposing to carry an extra argument all down the call
> stack, so there was no thread private data being used in the *_r() function
> code path.

Yep, understood - that may be more than we need here though, fortunately.

> Just by the way, we use thread private data in other places ... are these
> potential hand grenades waiting for a Python detonator?

If they are detached from the error handling like derived metrics currently,
then yeah possibly.  Which places did you have in mind?

cheers.

--
Nathan

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