Github user nonstop-qfchen commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/30#discussion_r34824507
--- Diff: core/sql/ustat/hs_globals.h ---
@@ -1889,6 +1897,8 @@ class HSGlobalsClass : public NABasicObject
Int64 stmtStartTime;
NABoolean jitLogOn;
+ static THREAD_P NABoolean performISForMC_;
--- End diff --
It is unfortunate that a static data member is used for the following
reason.
One of the methods modified to access the performISForMC_ data member is a
static method and as such the use of a static variable is a fit and
requires minimal changes in the surrounding code.
I feel we may need to refactor in this area later on.
On Thu, Jul 16, 2015 at 1:50 PM, DaveBirdsall <[email protected]>
wrote:
> In core/sql/ustat/hs_globals.h
>
<https://github.com/apache/incubator-trafodion/pull/30#discussion_r34823666>
> :
>
> > @@ -1889,6 +1897,8 @@ class HSGlobalsClass : public NABasicObject
> > Int64 stmtStartTime;
> > NABoolean jitLogOn;
> >
> > + static THREAD_P NABoolean performISForMC_;
>
> I'm wondering why this is a static variable. The constructor always
> initializes it to FALSE, so if there is more than one HSGlobalsClass
object
> created by a thread, one of the constructor calls will trash any value
that
> was set by method calls on the other object. Perhaps only one
> HSGlobalsClass object is created per thread, but if that is the case,
again
> I wonder why it is a static variable.
>
> â
> Reply to this email directly or view it on GitHub
> <https://github.com/apache/incubator-trafodion/pull/30/files#r34823666>.
>
--
Regards, --Qifan
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---