Click here to Skip to main content
15,921,793 members
Home / Discussions / C#
   

C#

 
GeneralRe: Clipboard Exception ? Pin
Mohammad Dayyan15-Aug-08 13:31
Mohammad Dayyan15-Aug-08 13:31 
GeneralRe: Clipboard Exception ? Pin
Paul Conrad15-Aug-08 13:34
professionalPaul Conrad15-Aug-08 13:34 
AnswerRe: Clipboard Exception ? Pin
JoeRip15-Aug-08 13:42
JoeRip15-Aug-08 13:42 
GeneralRe: Clipboard Exception ? Pin
Mohammad Dayyan16-Aug-08 2:18
Mohammad Dayyan16-Aug-08 2:18 
QuestionHow thread safe are static fields? Pin
JoeRip15-Aug-08 12:47
JoeRip15-Aug-08 12:47 
AnswerRe: How thread safe are static fields? Pin
Mark Salsbery15-Aug-08 12:53
Mark Salsbery15-Aug-08 12:53 
GeneralRe: How thread safe are static fields? Pin
JoeRip15-Aug-08 12:56
JoeRip15-Aug-08 12:56 
GeneralRe: How thread safe are static fields? Pin
Mark Salsbery15-Aug-08 13:29
Mark Salsbery15-Aug-08 13:29 
If you use Interlocked.Increment() / Interlocked.Decrement()
then the new value will be returned (an increment and a read
are combined in one atomic operation).

Reading (for integer types) is atomic (except for 64-bit integers
on a 32-bit processor) so there's no Interlocked.Read except for
longs.

You could use Interlocked.Exchange() if that's what you need to do,
but it's not appropriate for just reading the value (what value would
you exchange?).

To write/modify the variable beyond the atomic operations provided by the
Interlocked class, you'll need to use some other type critical section,
like lock.

Mark

Mark Salsbery
Microsoft MVP - Visual C++

Java | [Coffee]

GeneralRe: How thread safe are static fields? Pin
JoeRip15-Aug-08 13:47
JoeRip15-Aug-08 13:47 
QuestionDo I still need to LOCK a Synchronized Queue? Pin
JoeRip15-Aug-08 11:51
JoeRip15-Aug-08 11:51 
AnswerRe: Do I still need to LOCK a Synchronized Queue? Pin
Wendelius15-Aug-08 12:30
mentorWendelius15-Aug-08 12:30 
GeneralRe: Do I still need to LOCK a Synchronized Queue? Pin
JoeRip15-Aug-08 12:33
JoeRip15-Aug-08 12:33 
GeneralRe: Do I still need to LOCK a Synchronized Queue? Pin
Wendelius15-Aug-08 12:43
mentorWendelius15-Aug-08 12:43 
GeneralRe: Do I still need to LOCK a Synchronized Queue? Pin
JoeRip15-Aug-08 12:49
JoeRip15-Aug-08 12:49 
QuestionDeserialization, after GZipStream it´s possible?? (What is Wrong??) Pin
Guilherme Morais15-Aug-08 11:46
Guilherme Morais15-Aug-08 11:46 
AnswerRe: Deserialization, after GZipStream it´s possible?? (What is Wrong??) Pin
Guilherme Morais18-Aug-08 4:14
Guilherme Morais18-Aug-08 4:14 
QuestionHow to notify c# application from javascript Pin
tomc15-Aug-08 8:54
tomc15-Aug-08 8:54 
AnswerRe: How to notify c# application from javascript Pin
Pete O'Hanlon15-Aug-08 9:01
mvePete O'Hanlon15-Aug-08 9:01 
QuestionC# Code To Change System Date/Time Doesn't Work Pin
Kevin Marois15-Aug-08 8:24
professionalKevin Marois15-Aug-08 8:24 
AnswerRe: C# Code To Change System Date/Time Doesn't Work Pin
Pete O'Hanlon15-Aug-08 8:52
mvePete O'Hanlon15-Aug-08 8:52 
AnswerRe: C# Code To Change System Date/Time Doesn't Work Pin
Mark Salsbery15-Aug-08 9:00
Mark Salsbery15-Aug-08 9:00 
GeneralRe: C# Code To Change System Date/Time Doesn't Work Pin
Kevin Marois15-Aug-08 10:24
professionalKevin Marois15-Aug-08 10:24 
GeneralRe: C# Code To Change System Date/Time Doesn't Work Pin
Mycroft Holmes15-Aug-08 15:34
professionalMycroft Holmes15-Aug-08 15:34 
AnswerRe: C# Code To Change System Date/Time Doesn't Work Pin
Thomas Stockwell16-Aug-08 12:57
professionalThomas Stockwell16-Aug-08 12:57 
GeneralRe: C# Code To Change System Date/Time Doesn't Work Pin
alefaga8-May-09 5:00
alefaga8-May-09 5:00 

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.