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

C#

 
QuestionHello Peoples, Pin
Hema Bairavan16-Jan-09 0:45
Hema Bairavan16-Jan-09 0:45 
RantRe: Hello Peoples, Pin
Guffa16-Jan-09 1:16
Guffa16-Jan-09 1:16 
AnswerRe: Hello Peoples, Pin
Tom Deketelaere16-Jan-09 1:44
professionalTom Deketelaere16-Jan-09 1:44 
GeneralRe: Hello Peoples, Pin
Hema Bairavan16-Jan-09 4:30
Hema Bairavan16-Jan-09 4:30 
QuestionOk Mr Tom Pin
Hema Bairavan16-Jan-09 4:46
Hema Bairavan16-Jan-09 4:46 
AnswerRe: Ok Mr Tom Pin
Tom Deketelaere16-Jan-09 4:52
professionalTom Deketelaere16-Jan-09 4:52 
QuestionCaching Method Pin
satsumatable16-Jan-09 0:27
satsumatable16-Jan-09 0:27 
AnswerRe: Caching Method Pin
Steve Hansen16-Jan-09 2:58
Steve Hansen16-Jan-09 2:58 
QuestionBinding two datasets to gridview in windows application. Pin
shaik abdul gani15-Jan-09 23:49
shaik abdul gani15-Jan-09 23:49 
QuestionPrint an arrays by coulms Pin
newbie_15-Jan-09 23:19
newbie_15-Jan-09 23:19 
QuestionRe: Print an arrays by coulms Pin
CPallini15-Jan-09 23:36
mveCPallini15-Jan-09 23:36 
AnswerRe: Print an arrays by coulms Pin
SeMartens15-Jan-09 23:41
SeMartens15-Jan-09 23:41 
GeneralRe: Print an arrays by coulms Pin
J a a n s15-Jan-09 23:52
professionalJ a a n s15-Jan-09 23:52 
GeneralRe: Print an arrays by coulms Pin
SeMartens15-Jan-09 23:58
SeMartens15-Jan-09 23:58 
GeneralRe: Print an arrays by coulms [modified] Pin
newbie_15-Jan-09 23:58
newbie_15-Jan-09 23:58 
Questionhow can i suppress Microsoft .NET security warning. [modified] Pin
Dattatraya K15-Jan-09 23:09
Dattatraya K15-Jan-09 23:09 
AnswerRe: how can i suppress Microsoft .NET security warning. Pin
SeMartens15-Jan-09 23:17
SeMartens15-Jan-09 23:17 
GeneralRe: how can i suppress Microsoft .NET security warning. Pin
Dattatraya K15-Jan-09 23:20
Dattatraya K15-Jan-09 23:20 
GeneralRe: how can i suppress Microsoft .NET security warning. Pin
SeMartens15-Jan-09 23:35
SeMartens15-Jan-09 23:35 
GeneralRe: how can i suppress Microsoft .NET security warning. Pin
Dave Kreskowiak16-Jan-09 4:01
mveDave Kreskowiak16-Jan-09 4:01 
QuestionProgramatically setting the smtp server in Outlook 2003 Pin
WritinCode15-Jan-09 22:51
WritinCode15-Jan-09 22:51 
AnswerRe: Programatically setting the smtp server in Outlook 2003 Pin
campurr3-Apr-10 5:44
campurr3-Apr-10 5:44 
QuestionSynchronization via Locks Pin
the_jat15-Jan-09 21:57
the_jat15-Jan-09 21:57 
AnswerRe: Synchronization via Locks Pin
SeMartens15-Jan-09 22:18
SeMartens15-Jan-09 22:18 
Hi,

so let me try to explain this.

The lock construct itself just helps the programmer to serialize multiple threads trying to accessing a critical path in an application. The lock statement itself doesn't protect the static variable, it is "protecting" the path within the construct. What the programmer does within the critical path is up to himself, so the lock construct doesn't know anything about the static variable.

If the programmer is not strict enough and access the lock static variable outside of an lock-construct (Attention: locking over the same lock-object) than the lock construct itself is useless.

What the author meant (in my opinon) is that he wants to make clear that the programmer has to be aware that whenever he/she wants to access a critical variable (or accessing a critical path) he has to use locks.

Does this help you a bit?

Regards
Sebastian

It's not a bug, it's a feature!

Me in Softwareland.

GeneralRe: Synchronization via Locks Pin
the_jat15-Jan-09 22:44
the_jat15-Jan-09 22:44 

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.