Re: Discontent with development process (was:Re: pgaccess - the discussion is over) - Mailing list pgsql-hackers

From Myron Scott
Subject Re: Discontent with development process (was:Re: pgaccess - the discussion is over)
Date
Msg-id 3CE1252C.3090006@sacadia.com
Whole thread Raw
In response to pgaccess - the discussion is over  ("Iavor Raytchev" <iavor.raytchev@verysmall.org>)
Responses Re: Discontent with development process (was:Re: pgaccess - the discussion is over)  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers

Tom Lane wrote:

>Hannu Krosing <hannu@tm.ee> writes:
>
>>What would your opinion be of some hack with macros, like 
>>
>
>>#if (Win32 or THREADED)
>>#define GLOBAL_ pg_globals.
>>#else
>>#define GLOBAL_
>>#endif
>>
>
>>and then use global variables as
>>
>
>>GLOBAL_globvar
>>
>
>>At least in my opinion that would increase both readability and
>>maintainability.
>>
>
>>From a code readability viewpoint this is not at all better than just
>moving everything to pg_globals.  You're only spelling "pg_globals."
>a little differently.  And it introduces twin possibilities for error:
>omitting GLOBAL_ (if you're a Unix developer) or writing
>pg_globals. explicitly (if you're a Win32 guy).  I suppose these errors
>would be caught as soon as someone tried to compile on the other
>platform, but it still seems like a mess with little redeeming value.
>

Another suggestion might be to create a global hashtable that stores the 
size and pointer
to global structures for each subsection.  Each subsection can define 
its own globals
structure and register them with the hashtable.  This would not impact 
readablity and
make the gobal environment easy to copy.  IMHO, this is possible with 
minimal performance
impact.

Myron Scott
mkscott@sacadia.com




pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Discontent with development process (was:Re: pgaccess - the discussion is over)
Next
From: Tom Lane
Date:
Subject: Re: Discontent with development process (was:Re: pgaccess - the discussion is over)