Re: gpilotd.c issues

On Mon, 8 Feb 1999, Eskil Heyn Olsen wrote:

> Oy...
> In gpilotd.c, the GPilotContext* is given as argument for a lot of
> structures, and in general, passing this around like this seems more a
> hassle then a benefit.
> To get access to device lists etc, GPilotd_Orb_Context, a structure for
> maintaininig context for the orb-part of gpilotd, has a pointer to a
> GPilotContext.
> And now I've ended up accessing the one and only GPilotContext through the
> globally defined GPilotd_Orb_Context, in gpilotd.c... yuck.
> Are there any heavily arguments against me defining a global GPilotContext
> variable, which holds the context, or perhaps better, a
> get_gpilot_context() call which returns the correct context ?
> eskil
> ---

As I said previously, I haven't had time to look at the code to make an
intelligent suggestion, but my gut reaction is to not make it global.  I
wanted the context to be separate so that we might thread gpilotd for
example.  In the original incarnation every forked copy had a different
context.  The code has changed enough so I don't know if this is a valid
assumption anymore.  If we don't need a different context for threaded
operation, etc. then we should just make it global.  The other possibility
is to take the orb stuff and make it global.  It seems to be more baggage
than its worth in the Context structure and can be shared by multiple
contexts anyway.

Manish Vachharajani               Some Haiku: A crash reduces
<>                   your expensive computer
                                              to a simple stone - Unknown

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]