Click here to Skip to main content
15,890,512 members
Home / Discussions / C#
   

C#

 
AnswerRe: thread safety PinPopular
Luc Pattyn24-Aug-11 12:10
sitebuilderLuc Pattyn24-Aug-11 12:10 
GeneralRe: thread safety Pin
AspDotNetDev24-Aug-11 12:18
protectorAspDotNetDev24-Aug-11 12:18 
GeneralRe: thread safety Pin
CodingYoshi24-Aug-11 16:44
CodingYoshi24-Aug-11 16:44 
GeneralRe: thread safety PinPopular
Luc Pattyn24-Aug-11 17:16
sitebuilderLuc Pattyn24-Aug-11 17:16 
GeneralRe: thread safety Pin
CodingYoshi25-Aug-11 3:28
CodingYoshi25-Aug-11 3:28 
AnswerRe: thread safety Pin
Luc Pattyn25-Aug-11 3:38
sitebuilderLuc Pattyn25-Aug-11 3:38 
AnswerRe: thread safety Pin
AspDotNetDev24-Aug-11 12:17
protectorAspDotNetDev24-Aug-11 12:17 
AnswerRe: thread safety Pin
PIEBALDconsult24-Aug-11 17:42
mvePIEBALDconsult24-Aug-11 17:42 
From the documentation[^]:

"
In general, avoid locking on a public type, or instances beyond your code's control. The common constructs lock (this), lock (typeof (MyType)), and lock ("myLock") violate this guideline:

lock (this) is a problem if the instance can be accessed publicly.

lock (typeof (MyType)) is a problem if MyType is publicly accessible.

lock(“myLock”) is a problem since any other code in the process using the same string, will share the same lock.

Best practice is to define a private object to lock on, or a private static object variable to protect data common to all instances.
"
AnswerRe: thread safety Pin
jschell25-Aug-11 8:41
jschell25-Aug-11 8:41 
GeneralRe: thread safety Pin
CodingYoshi25-Aug-11 15:01
CodingYoshi25-Aug-11 15:01 
GeneralRe: thread safety Pin
jschell26-Aug-11 8:28
jschell26-Aug-11 8:28 
QuestionWhat is the best way to make application Multi Language ? Pin
Honeyboy_2024-Aug-11 11:15
Honeyboy_2024-Aug-11 11:15 
JokeRe: What is the best way to make application Multi Language ? Pin
PIEBALDconsult24-Aug-11 14:56
mvePIEBALDconsult24-Aug-11 14:56 
GeneralRe: What is the best way to make application Multi Language ? Pin
Subin Mavunkal25-Aug-11 1:48
Subin Mavunkal25-Aug-11 1:48 
GeneralRe: What is the best way to make application Multi Language ? Pin
PIEBALDconsult25-Aug-11 2:43
mvePIEBALDconsult25-Aug-11 2:43 
AnswerRe: What is the best way to make application Multi Language ? Pin
simplefolk25-Aug-11 3:51
simplefolk25-Aug-11 3:51 
AnswerRe: What is the best way to make application Multi Language ? Pin
Bernhard Hiller25-Aug-11 5:05
Bernhard Hiller25-Aug-11 5:05 
Questionhow to convert my C# winform program to service program ? Pin
Gali197824-Aug-11 6:53
Gali197824-Aug-11 6:53 
AnswerRe: how to convert my C# winform program to service program ? Pin
Hari Om Prakash Sharma24-Aug-11 7:15
Hari Om Prakash Sharma24-Aug-11 7:15 
AnswerRe: how to convert my C# winform program to service program ? Pin
#realJSOP24-Aug-11 8:01
mve#realJSOP24-Aug-11 8:01 
QuestionProblem in work with ocx file Pin
SajjadZare24-Aug-11 5:08
SajjadZare24-Aug-11 5:08 
AnswerRe: Problem in work with ocx file Pin
Rob Philpott24-Aug-11 5:17
Rob Philpott24-Aug-11 5:17 
GeneralRe: Problem in work with ocx file Pin
SajjadZare24-Aug-11 5:34
SajjadZare24-Aug-11 5:34 
GeneralRe: Problem in work with ocx file Pin
Rob Philpott24-Aug-11 6:00
Rob Philpott24-Aug-11 6:00 
AnswerRe: Problem in work with ocx file Pin
Nagy Vilmos24-Aug-11 5:18
professionalNagy Vilmos24-Aug-11 5:18 

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.