libcvd-members
[Top][All Lists]
Advanced

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

Re: [libcvd-members] gvars3 Makefile.in configure configure.ac gvars...


From: Georg Klein
Subject: Re: [libcvd-members] gvars3 Makefile.in configure configure.ac gvars...
Date: Wed, 20 Feb 2008 22:12:01 +0000 (GMT)

On Wed, 20 Feb 2008, Edward Rosten wrote:

On Wed, 20 Feb 2008, Georg Klein wrote:

Nice.

The whole global-initialised-in-a-library thing does seem rather unsafe when other classes use it in a constructor!

True. I don't know exactly what the best solution is. Something to do with singleton classes.

GVars2 had no globals defined in the library, so that you could define them in main.cc, in the order they need. Wherever they live, all inter-dependent globals should live in one translation unit, and that's what you've done in gvars3's inst.cc, but it doesn't work (portably) when I have other global classes which call GUI in their constructors.

A trivial fix would be a configure flag which excludes inst.cc from the library. This would fix all of my problems. Unless you're on a configure editing buzz, I'll get around to doing this some time soon.

Not to mention the entire thread safety thing...

There's two solutions to that as far as I can see.

One is to put locks around the whole GVars3 database.

The other is to have all widgets sets operate using their own private string-tring map. Every so often, you will have to call a synchronize method which will synchronize the GVars database with the private map.

The second version is nice because it keeps gvars fast and you know that in your main loop, things aren't going to change from under you.

(Shrug)
I don't use any of the widget sets! I suspect there's probably a lot of stuff which no-one uses anymore in there. For example, IIRC headless was requested by Ethan, but I think he uses his own thing now instead of gvars?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]