Click here to Skip to main content
15,912,400 members
Home / Discussions / C#
   

C#

 
GeneralRe: Help, how to delete nodes xml in c# Pin
J4amieC27-Mar-08 1:07
J4amieC27-Mar-08 1:07 
GeneralRe: Help, how to delete nodes xml in c# Pin
woke27-Mar-08 21:06
woke27-Mar-08 21:06 
GeneralRe: Help, how to delete nodes xml in c# Pin
J4amieC27-Mar-08 22:47
J4amieC27-Mar-08 22:47 
Questionfind row in database Pin
Metik26-Mar-08 22:33
Metik26-Mar-08 22:33 
GeneralRe: find row in database Pin
Rajesh R Subramanian26-Mar-08 23:27
professionalRajesh R Subramanian26-Mar-08 23:27 
GeneralRe: find row in database Pin
Metik26-Mar-08 23:50
Metik26-Mar-08 23:50 
GeneralRe: find row in database Pin
Gareth H27-Mar-08 0:09
Gareth H27-Mar-08 0:09 
QuestionPlz can anyone help me to get a code in c# that extract Ethernet type Pin
merh26-Mar-08 22:14
merh26-Mar-08 22:14 
QuestionRe: Plz can anyone help me to get a code in c# that extract Ethernet type Pin
CPallini26-Mar-08 23:31
mveCPallini26-Mar-08 23:31 
JokeRe: Plz can anyone help me to get a code in c# that extract Ethernet type Pin
leppie26-Mar-08 23:35
leppie26-Mar-08 23:35 
QuestionRe: Plz can anyone help me to get a code in c# that extract Ethernet type Pin
merh26-Mar-08 23:52
merh26-Mar-08 23:52 
QuestionHow can I make my GUI app launch smoothly? Pin
lemueladane26-Mar-08 21:38
lemueladane26-Mar-08 21:38 
GeneralRe: How can I make my GUI app launch smoothly? Pin
Giorgi Dalakishvili26-Mar-08 21:49
mentorGiorgi Dalakishvili26-Mar-08 21:49 
GeneralRe: How can I make my GUI app launch smoothly? Pin
phannon8626-Mar-08 23:00
professionalphannon8626-Mar-08 23:00 
GeneralRe: How can I make my GUI app launch smoothly? Pin
Pete O'Hanlon26-Mar-08 23:26
mvePete O'Hanlon26-Mar-08 23:26 
GeneralRe: How can I make my GUI app launch smoothly? Pin
Gareth H27-Mar-08 0:01
Gareth H27-Mar-08 0:01 
GeneralReceive Cursor X, Y Positions Pin
M Riaz Bashir26-Mar-08 21:32
M Riaz Bashir26-Mar-08 21:32 
GeneralRe: Receive Cursor X, Y Positions Pin
Christian Graus26-Mar-08 21:59
protectorChristian Graus26-Mar-08 21:59 
GeneralRe: Receive Cursor X, Y Positions Pin
MarkB77726-Mar-08 23:18
MarkB77726-Mar-08 23:18 
GeneralRe: Receive Cursor X, Y Positions Pin
M Riaz Bashir27-Mar-08 19:36
M Riaz Bashir27-Mar-08 19:36 
GeneralInfinite level hierarchical data grid code using C# with edit ,update option Pin
pp831926-Mar-08 20:42
pp831926-Mar-08 20:42 
GeneralRe: Infinite level hierarchical data grid code using C# with edit ,update option Pin
Eduard Keilholz26-Mar-08 23:00
Eduard Keilholz26-Mar-08 23:00 
GeneralRe: Infinite level hierarchical data grid code using C# with edit ,update option Pin
pp831927-Mar-08 20:18
pp831927-Mar-08 20:18 
GeneralThread safety Pin
N a v a n e e t h26-Mar-08 20:04
N a v a n e e t h26-Mar-08 20:04 
I am doing a multi threaded application. In this application, configurations are kept in an XML file and loaded as a singleton instance. I have a class to manage this XML file say Configuration. This Configuration class has a Current property which is a singleton instance.
private static object locker = new object();
private static Configuration _configuration;
public static Configuration Current
{
   get
   {
       if(_configuration == null)
       {
            lock(locker){
               _configuration = LoadConfiguration();
            }
       }
       return _configuration;
   }
}
Is this code thread safe ? Assume first thread has locked and started to fill the _configuration instance. But before it completes, another thread requests the Current property and comes inside the if block. It will be queued until the lock gets released. But after the lock gets released, will that thread creates the instance again ? I am kinda confused at this point. Any help ?

All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia

How to use google | Ask smart questions

GeneralRe: Thread safety Pin
Luc Pattyn26-Mar-08 20:55
sitebuilderLuc Pattyn26-Mar-08 20:55 

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.