Click here to Skip to main content
16,020,459 members
Home / Discussions / C#
   

C#

 
GeneralRe: God book on patterns in C# Pin
ervar24-Aug-03 20:38
ervar24-Aug-03 20:38 
GeneralRe: God book on patterns in C# Pin
Jim Stewart26-Aug-03 10:20
Jim Stewart26-Aug-03 10:20 
GeneralCuting out a part of a bitmap Pin
Ylis23-Aug-03 11:45
Ylis23-Aug-03 11:45 
GeneralRe: Cuting out a part of a bitmap Pin
J. Dunlap23-Aug-03 13:47
J. Dunlap23-Aug-03 13:47 
GeneralRe: Cuting out a part of a bitmap Pin
Ista23-Aug-03 19:17
Ista23-Aug-03 19:17 
GeneralRe: Cuting out a part of a bitmap Pin
Ylis24-Aug-03 6:12
Ylis24-Aug-03 6:12 
GeneralEFFICIENCY: lock{} or .Synchronized Pin
MeisterBiber23-Aug-03 11:45
MeisterBiber23-Aug-03 11:45 
GeneralRe: EFFICIENCY: lock{} or .Synchronized Pin
Julian Bucknall [MSFT]25-Aug-03 10:15
Julian Bucknall [MSFT]25-Aug-03 10:15 
Andi

There's no difference performance-wise. (Synchronized uses the lock keyword itself.) Sop it boils down to whether you need to specify the actual intent in your code. With

lock(MyArrayList) {
  MyArrayList.This();
  MyArrayList.That();
  MyArrayList.TheOther();
}

you are explicitly stating that, yes, this is threadsafe. Look, there's the lock keyword. With

MyArrayList.This();
MyArrayList.That();
MyArrayList.TheOther();

you are saying, trust me, I've set up MyArrayList to be a Synchronized version of another ArrayList, so this is threadsafe. Maybe the code that sets up the Synchronized version is nearby, so it's obvious (say in a using block).

Of course, if you forget to set up MyArrayList in that way, you've got a bug.



Cheers, Julian
Program Manager, C#

This posting is provided "AS IS" with no warranties, and confers no rights.
General80% call doA() , 20% call doB() Pin
MeisterBiber23-Aug-03 7:01
MeisterBiber23-Aug-03 7:01 
GeneralRe: 80% call doA() , 20% call doB() Pin
Daniel Turini23-Aug-03 12:10
Daniel Turini23-Aug-03 12:10 
GeneralRe: 80% call doA() , 20% call doB() Pin
MeisterBiber23-Aug-03 13:21
MeisterBiber23-Aug-03 13:21 
GeneralRestricting access to non *.aspx files Pin
Meysam Mahfouzi22-Aug-03 18:16
Meysam Mahfouzi22-Aug-03 18:16 
GeneralRe: Restricting access to non *.aspx files Pin
Mazdak22-Aug-03 19:38
Mazdak22-Aug-03 19:38 
Generalcan't receive KeyPress Event in Window Form Pin
zecodela22-Aug-03 15:22
zecodela22-Aug-03 15:22 
GeneralRe: can't receive KeyPress Event in Window Form Pin
MeisterBiber23-Aug-03 8:38
MeisterBiber23-Aug-03 8:38 
GeneralRe: can't receive KeyPress Event in Window Form Pin
Ista23-Aug-03 15:39
Ista23-Aug-03 15:39 
GeneralRe: can't receive KeyPress Event in Window Form Pin
A.Wegierski24-Aug-03 20:07
A.Wegierski24-Aug-03 20:07 
GeneralRe: can't receive KeyPress Event in Window Form Pin
Ista25-Aug-03 3:22
Ista25-Aug-03 3:22 
GeneralDistribute code in separate files Pin
sumeat22-Aug-03 14:01
sumeat22-Aug-03 14:01 
GeneralRe: Distribute code in separate files Pin
J. Dunlap22-Aug-03 14:13
J. Dunlap22-Aug-03 14:13 
GeneralCaret implementation Pin
Lasse Johansen22-Aug-03 11:03
Lasse Johansen22-Aug-03 11:03 
GeneralRe: Caret implementation Pin
A.Wegierski24-Aug-03 20:23
A.Wegierski24-Aug-03 20:23 
GeneralRe: Caret implementation Pin
Lasse Johansen26-Aug-03 9:50
Lasse Johansen26-Aug-03 9:50 
QuestionHow to change Back Color of ToolBar Pin
sumeat22-Aug-03 9:39
sumeat22-Aug-03 9:39 
GeneralRemote Object in IIS Pin
Mazdak22-Aug-03 7:23
Mazdak22-Aug-03 7:23 

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.