Click here to Skip to main content
15,895,011 members
Home / Discussions / C#
   

C#

 
QuestionHow does a C# user control hosted in IE6 get a reference to its parent JSP Web form? Pin
Emitr21-Aug-08 8:22
Emitr21-Aug-08 8:22 
AnswerRe: How does a C# user control hosted in IE6 get a reference to its parent JSP Web form? Pin
The Cake of Deceit22-Aug-08 8:39
The Cake of Deceit22-Aug-08 8:39 
GeneralRe: How does a C# ActiveX control get a reference to the IE browser? Pin
Emitr22-Aug-08 10:22
Emitr22-Aug-08 10:22 
GeneralRe: How does a C# ActiveX control get a reference to the IE browser? Pin
The Cake of Deceit23-Aug-08 10:22
The Cake of Deceit23-Aug-08 10:22 
QuestionCustom Exception Handling "Best Practise" Pin
Spaz8021-Aug-08 7:32
Spaz8021-Aug-08 7:32 
AnswerRe: Custom Exception Handling "Best Practise" Pin
Christian Graus21-Aug-08 11:45
protectorChristian Graus21-Aug-08 11:45 
GeneralRe: Custom Exception Handling "Best Practise" Pin
Ravi Bhavnani21-Aug-08 13:46
professionalRavi Bhavnani21-Aug-08 13:46 
QuestionSingleton Pattern Confusion Pin
Brendan Vogt21-Aug-08 6:37
Brendan Vogt21-Aug-08 6:37 
Hi,

I am working through the Singleton pattern from www.dofactory.com, and I am not understanding the code at the bottom. I do not understand why they check twice for instance == null, please can some one help explain:

// Lock synchronization object
private static object syncLock = new object();

// Support multithreaded applications through
// 'Double checked locking' pattern which (once
// the instance exists) avoids locking each
// time the method is invoked
if (instance == null)
{
   lock (syncLock)
   {
      if (instance == null)
      {
         instance = new LoadBalancer();
      }
   }
}


Actually I don't understand anything ob the above mentioned code..

Thanks
Brendan
AnswerRe: Singleton Pattern Confusion Pin
N a v a n e e t h21-Aug-08 6:41
N a v a n e e t h21-Aug-08 6:41 
GeneralRe: Singleton Pattern Confusion Pin
Brendan Vogt21-Aug-08 6:45
Brendan Vogt21-Aug-08 6:45 
AnswerRe: Singleton Pattern Confusion Pin
PIEBALDconsult21-Aug-08 8:30
mvePIEBALDconsult21-Aug-08 8:30 
AnswerRe: Singleton Pattern Confusion Pin
Pete O'Hanlon21-Aug-08 8:34
mvePete O'Hanlon21-Aug-08 8:34 
GeneralRe: Singleton Pattern Confusion Pin
Björn Friedrich23-Aug-08 3:58
Björn Friedrich23-Aug-08 3:58 
AnswerRe: Singleton Pattern Confusion Pin
Björn Friedrich23-Aug-08 3:57
Björn Friedrich23-Aug-08 3:57 
QuestionPolymorphism Pin
Ram_Bytes21-Aug-08 5:44
Ram_Bytes21-Aug-08 5:44 
AnswerRe: Polymorphism PinPopular
Dan Neely21-Aug-08 7:03
Dan Neely21-Aug-08 7:03 
JokeRe: Polymorphism Pin
Manas Bhardwaj21-Aug-08 7:19
professionalManas Bhardwaj21-Aug-08 7:19 
GeneralRe: Polymorphism Pin
Dan Neely21-Aug-08 7:46
Dan Neely21-Aug-08 7:46 
GeneralRe: Polymorphism Pin
Kevin McFarlane22-Aug-08 0:33
Kevin McFarlane22-Aug-08 0:33 
GeneralRe: Polymorphism Pin
Yusuf21-Aug-08 8:30
Yusuf21-Aug-08 8:30 
GeneralRe: Polymorphism Pin
vikas amin21-Aug-08 10:09
vikas amin21-Aug-08 10:09 
GeneralRe: Polymorphism Pin
Ravi Bhavnani21-Aug-08 13:50
professionalRavi Bhavnani21-Aug-08 13:50 
GeneralRe: Polymorphism Pin
ChandraRam21-Aug-08 20:49
ChandraRam21-Aug-08 20:49 
AnswerRe: Polymorphism Pin
Manas Bhardwaj21-Aug-08 7:18
professionalManas Bhardwaj21-Aug-08 7:18 
AnswerRe: Polymorphism Pin
Robert.C.Cartaino21-Aug-08 7:21
Robert.C.Cartaino21-Aug-08 7:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.