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

C#

 
GeneralRe: Threading Question Pin
Nader Elshehabi12-Dec-06 8:54
Nader Elshehabi12-Dec-06 8:54 
GeneralRe: Threading Question Pin
NameYou12-Dec-06 9:47
NameYou12-Dec-06 9:47 
GeneralRe: Threading Question Pin
Nader Elshehabi12-Dec-06 17:11
Nader Elshehabi12-Dec-06 17:11 
GeneralRe: Threading Question Pin
NameYou13-Dec-06 2:18
NameYou13-Dec-06 2:18 
GeneralRe: Threading Question Pin
Nader Elshehabi13-Dec-06 6:16
Nader Elshehabi13-Dec-06 6:16 
GeneralRe: Threading Question [modified] Pin
Eric Dahlvang12-Dec-06 10:03
Eric Dahlvang12-Dec-06 10:03 
GeneralRe: Threading Question Pin
Andy Brummer12-Dec-06 17:21
sitebuilderAndy Brummer12-Dec-06 17:21 
GeneralRe: Threading Question Pin
Eric Dahlvang13-Dec-06 3:02
Eric Dahlvang13-Dec-06 3:02 
Andy Brummer wrote:
Actually, the first block doesn't do any locking at all since each method doesn't share the lock object.

That's what i was trying to say.

Andy Brummer wrote:
Your example blocks all instances, it doesn't matter how many MyObjects there are, only one of them can execute the locked code at any time.

Removing the static keyword from cFieldVal will protect the value for each instance.

The intention of the example was to have a lock that every instance shares, and I should have said EVERY rather than EACH. I have changed it. Thanks for pointing that out.



--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters

GeneralRe: Threading Question Pin
Nader Elshehabi12-Dec-06 17:24
Nader Elshehabi12-Dec-06 17:24 
AnswerRe: Threading Question Pin
karam chandrabose12-Dec-06 22:45
karam chandrabose12-Dec-06 22:45 
GeneralRe: Threading Question Pin
NameYou13-Dec-06 1:32
NameYou13-Dec-06 1:32 
AnswerRe: Threading Question Pin
sno-114-Dec-06 3:52
sno-114-Dec-06 3:52 
Questionfont Pin
hadad12-Dec-06 6:49
hadad12-Dec-06 6:49 
AnswerRe: font Pin
Nader Elshehabi12-Dec-06 7:59
Nader Elshehabi12-Dec-06 7:59 
Questionsending messages to a window from a windows service Pin
George_Lucian12-Dec-06 5:49
George_Lucian12-Dec-06 5:49 
AnswerRe: sending messages to a window from a windows service Pin
Nader Elshehabi12-Dec-06 8:05
Nader Elshehabi12-Dec-06 8:05 
QuestionDisabling the context menu [interop.word.dll] Pin
Eytukan12-Dec-06 4:38
Eytukan12-Dec-06 4:38 
QuestionWeb Service Proxy Problem! Pin
Mehdi Mousavi12-Dec-06 4:32
Mehdi Mousavi12-Dec-06 4:32 
AnswerRe: Web Service Proxy Problem! Pin
Andy Brummer12-Dec-06 17:27
sitebuilderAndy Brummer12-Dec-06 17:27 
AnswerRe: Web Service Proxy Problem! Pin
Mehdi Mousavi12-Dec-06 19:11
Mehdi Mousavi12-Dec-06 19:11 
GeneralRe: Web Service Proxy Problem! Pin
Andy Brummer13-Dec-06 4:10
sitebuilderAndy Brummer13-Dec-06 4:10 
QuestionToolTab Gone Hay Wire Pin
burrows.stephen12-Dec-06 4:30
burrows.stephen12-Dec-06 4:30 
AnswerRe: ToolTab Gone Hay Wire Pin
Judah Gabriel Himango12-Dec-06 6:47
sponsorJudah Gabriel Himango12-Dec-06 6:47 
GeneralRe: ToolTab Gone Hay Wire Pin
burrows.stephen13-Dec-06 1:00
burrows.stephen13-Dec-06 1:00 
QuestionString conversion Pin
Eduard Keilholz12-Dec-06 4:05
Eduard Keilholz12-Dec-06 4:05 

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.