Hi Tanguy,

We've encountered several times a random deadlock that would happen when
starting our application. After some playing around, we've identified
the problem to be quite a subtle one.

What you're describing makes sense in some way, but I have two questions:

1. Why have there not been more discussions about random deadlocks in the recent past? For example, we have not experienced anything resembling what you describe. I am not an expert in Win32 programming, so what you describe may well be true, but we haven't encountered this, and I'm pretty sure if it were such a widespread problem we'd have heard of it on this list before. Of course, that's not proof in itself that the issue is not there, but it's an indication that it might be something on your side rather than a widespread problem.

2. If singletons are bad practice as you say, what do you propose to replace them? I'm always a bit skeptical of sentences like "Google is full of papers [saying that singletons are broken]". People have a tendency to be extreme in their judgements, and if someone finds an instance where singletons give bad results, they will often start saying that they are bad in all cases (and inevitably post to their blog about it). It's a tool for a job, and the developer has to know when to use it and when not to. That's the developer's responsibility, not the tool's.

I'm not saying that all uses of singletons in OSG are good ones (most obviously because I've probably not personally seen all of them) but singletons are useful (they give a single point of access to something - data, functionality) and that has to be replaced by something else if singletons have a downside in some/most/all(?) situations.

J-S
--
______________________________________________________
Jean-Sebastien Guay    [email protected]
                               http://www.cm-labs.com/
                        http://whitestar02.webhop.org/
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to