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: Edward Rosten
Subject: Re: [libcvd-members] gvars3 Makefile.in configure configure.ac gvars...
Date: Wed, 20 Feb 2008 15:28:25 -0700 (MST)

On Wed, 20 Feb 2008, Georg Klein wrote:

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.


Hm. I like having the classes ready instantiated, since it cuts down on the code. I could go back to having ifdefs so that GVars instantiates everything in the same inst.cc file.

Also, you could generate a new .so library. One .so has all the code, but no instantiations. The other .so has the instantiations and points back to the .so with the code in.

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!

Do you do everything in your OpenGL widget set these days?

I still use widget sets quite a lot. I've written some quite largeish GUIs that way...

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?

Oh. I actually put the headless stuff in there. I ocasionally need to run batch jobs on a cluster. It's pretty handy for that, since those machines frequently don't have GUI libraries installed, and I can use the same code for interactive and batch use.

-Ed





reply via email to

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