Click here to Skip to main content
15,886,919 members
Home / Discussions / C#
   

C#

 
GeneralReading Files From Offset Pin
afronaut17-Feb-03 13:19
afronaut17-Feb-03 13:19 
GeneralRe: Reading Files From Offset Pin
Xpander17-Feb-03 16:14
Xpander17-Feb-03 16:14 
GeneralRe: Reading Files From Offset Pin
Wesner Moise17-Feb-03 16:21
Wesner Moise17-Feb-03 16:21 
GeneralRe: Reading Files From Offset Pin
afronaut18-Feb-03 2:43
afronaut18-Feb-03 2:43 
GeneralRe: Reading Files From Offset Pin
Furty17-Feb-03 17:05
Furty17-Feb-03 17:05 
Questionprinting in .net problem? Pin
zhoujun17-Feb-03 13:13
zhoujun17-Feb-03 13:13 
GeneralMethod lock Pin
Filip Strugar17-Feb-03 12:55
Filip Strugar17-Feb-03 12:55 
GeneralRe: Method lock Pin
Wesner Moise17-Feb-03 16:03
Wesner Moise17-Feb-03 16:03 
I don't believe there is any difference.

This is how lock is implemented.

object tmp = this;
Monitor.Enter(tmp);
try
{
DoSomething();
}
finally
{
Monitor.Exit(tmp);
}

For static methods, the class type is used instead of this.

From the specification, synchronized works the same as using lock(this) and lock(typeof(Class)) for statics around the method. I think both actually used the syncblockindex that every object has, so that mixed use will probably work correctly as well.

But in one Microsoft article on performance, it was suggested that synchronized function calls are faster than using locks. I think the reasoning used was that fine-grained locks are less performant--the higher-up the synchronization, the less overhead incurred because of fewer traffic lights.

My guess is that the implementation is actually the same.


QuestionHow do you use this DLL in C#? Pin
draco_iii17-Feb-03 9:43
draco_iii17-Feb-03 9:43 
AnswerRe: How do you use this DLL in C#? Pin
Anders Molin17-Feb-03 14:12
professionalAnders Molin17-Feb-03 14:12 
GeneraldotEASY Pin
Anonymous17-Feb-03 9:38
Anonymous17-Feb-03 9:38 
QuestionQ: How to Click a Button in Another Application Programatically in C#? Pin
Alwazeer17-Feb-03 7:28
Alwazeer17-Feb-03 7:28 
AnswerRe: Q: How to Click a Button in Another Application Programatically in C#? Pin
TigerNinja_17-Feb-03 7:55
TigerNinja_17-Feb-03 7:55 
QuestionC# Syntax Highlighting? Pin
se99ts17-Feb-03 6:00
se99ts17-Feb-03 6:00 
AnswerRe: C# Syntax Highlighting? Pin
Furty17-Feb-03 9:47
Furty17-Feb-03 9:47 
GeneralRe: C# Syntax Highlighting? Pin
se99ts17-Feb-03 9:51
se99ts17-Feb-03 9:51 
QuestionIs it possible to declare reference variable? Pin
Thomas W17-Feb-03 4:27
Thomas W17-Feb-03 4:27 
AnswerRe: Is it possible to declare reference variable? Pin
TigerNinja_17-Feb-03 7:33
TigerNinja_17-Feb-03 7:33 
AnswerRe: Is it possible to declare reference variable? Pin
Jeff J17-Feb-03 16:32
Jeff J17-Feb-03 16:32 
GeneralRe: Is it possible to declare reference variable? Pin
Thomas W17-Feb-03 21:04
Thomas W17-Feb-03 21:04 
GeneralDatagrid and DataSet questions Pin
DionChen17-Feb-03 4:00
DionChen17-Feb-03 4:00 
GeneralRe: Datagrid and DataSet questions Pin
A.Wegierski17-Feb-03 21:04
A.Wegierski17-Feb-03 21:04 
GeneralWin2k and System.Net namespace Pin
Anonymous17-Feb-03 2:07
Anonymous17-Feb-03 2:07 
Generaldatagrid Pin
brain2cpu16-Feb-03 23:30
professionalbrain2cpu16-Feb-03 23:30 
QuestionWhat are Borlands plans for .NET? Pin
Zibar16-Feb-03 20:13
sussZibar16-Feb-03 20:13 

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.