Ticket #17 (assigned defect)

Opened 1 year ago

Last modified 1 year ago

Multiple singleton objects with static linking

Reported by: patrick Assigned to: patrick (accepted)
Priority: critical Milestone:
Component: VR Juggler Version: HEAD
Keywords: singleton static linking Cc:
Completion:

Description

I have run into some strange behavior wherein two different instances of the same singleton class are created when using static linking. In this case, I was testing jccl::ConfigManager, and two distinct pointer values were being returned by jccl::ConfigManager::instance(). I do not know what would cause this, but I suspect that there is probably a compiler or linker flag that would fix the problem. That's usually what ends up being the fix.

Attachments

Change History

03/15/07 18:52:13 changed by patrick

  • status changed from new to assigned.

A suggestion was made to use the volatile modifier on the static variable holding the singleton instance. This does not appear to fix the problem.

03/15/07 18:52:42 changed by patrick

A singleton implementation written by Jason Hise has recently been posted to the Boost mailing list. At a high level, it works quite similarly to vpr::Singleton<T>, but it is much more advanced. I am going to see if his implementation would solve the problem described in this bug report.


Add/Change #17 (Multiple singleton objects with static linking)




Change Properties
Action