Click here to Skip to main content
15,881,172 members
Home / Discussions / C#
   

C#

 
QuestionC# vs. J#? Pin
Mridang Agarwalla7-Sep-05 6:00
Mridang Agarwalla7-Sep-05 6:00 
AnswerRe: C# vs. J#? Pin
Mohamad Al Husseiny7-Sep-05 7:34
Mohamad Al Husseiny7-Sep-05 7:34 
AnswerRe: C# vs. J#? Pin
Christian Graus7-Sep-05 13:19
protectorChristian Graus7-Sep-05 13:19 
AnswerRe: C# vs. J#? Pin
Dave Doknjas7-Sep-05 15:06
Dave Doknjas7-Sep-05 15:06 
QuestionAn easy question, an easy response Pin
Stanciu Vlad7-Sep-05 5:55
Stanciu Vlad7-Sep-05 5:55 
QuestionHardware serial numbers??? Pin
Dr_C#7-Sep-05 5:42
Dr_C#7-Sep-05 5:42 
AnswerRe: Hardware serial numbers??? Pin
Mohamad Al Husseiny7-Sep-05 5:59
Mohamad Al Husseiny7-Sep-05 5:59 
QuestionLazy initialization ok? Pin
Judah Gabriel Himango7-Sep-05 5:39
sponsorJudah Gabriel Himango7-Sep-05 5:39 
I have a multithreaded app which creates several objects. Inside the object class is something like:

public ArrayList Associations
{
   get
   {
       // use lazy initialization to create the associations:
       if(this.assocs == null)
       {
           lock(this)
           {
               if(this.assocs == null)
               {
                   this.assocs = new ArrayList(500);
                   return this.assocs;
               }
           }
       }
       else return this.assocs;
   }
}


Is this kind of lazy initialization safe to do in a multithreaded environment?

Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Cops & Robbers
Judah Himango


AnswerRe: Lazy initialization ok? Pin
Andy Brummer7-Sep-05 7:09
sitebuilderAndy Brummer7-Sep-05 7:09 
AnswerRe: Lazy initialization ok? Pin
Andy Brummer7-Sep-05 9:13
sitebuilderAndy Brummer7-Sep-05 9:13 
GeneralRe: Lazy initialization ok? Pin
Judah Gabriel Himango7-Sep-05 11:02
sponsorJudah Gabriel Himango7-Sep-05 11:02 
QuestionWindows Service Pin
BECK77-Sep-05 5:20
BECK77-Sep-05 5:20 
AnswerRe: Windows Service Pin
John Fisher7-Sep-05 8:17
John Fisher7-Sep-05 8:17 
Questionraw WM_INPUT for IR Controller Pin
Lapje7-Sep-05 5:19
Lapje7-Sep-05 5:19 
QuestionComposite Key constraint logic Pin
Anonymous7-Sep-05 3:36
Anonymous7-Sep-05 3:36 
AnswerRe: Composite Key constraint logic Pin
Guffa7-Sep-05 4:09
Guffa7-Sep-05 4:09 
GeneralRe: Composite Key constraint logic Pin
Anonymous7-Sep-05 6:36
Anonymous7-Sep-05 6:36 
AnswerRe: Composite Key constraint logic Pin
Guffa8-Sep-05 11:35
Guffa8-Sep-05 11:35 
QuestionTargeting a Framework version? Pin
bosfan7-Sep-05 1:40
bosfan7-Sep-05 1:40 
Questionhours minutes seconds Pin
PHDENG817-Sep-05 1:27
PHDENG817-Sep-05 1:27 
AnswerRe: hours minutes seconds Pin
John Fisher7-Sep-05 7:06
John Fisher7-Sep-05 7:06 
AnswerRe: hours minutes seconds Pin
machocr7-Sep-05 11:43
machocr7-Sep-05 11:43 
QuestionHow to install a snapin for MMC 2.0?? Pin
Socket_Layer7-Sep-05 0:34
Socket_Layer7-Sep-05 0:34 
QuestionCan FolderBrowserDialog be extended? Pin
Socket_Layer7-Sep-05 0:29
Socket_Layer7-Sep-05 0:29 
QuestionFinding Excpetion Line Number Pin
Tiger4567-Sep-05 0:27
Tiger4567-Sep-05 0:27 

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.