Click here to Skip to main content
15,894,410 members
Home / Discussions / C#
   

C#

 
GeneralRe: Windows Form and Command Line Pin
jtmtv1817-Feb-03 19:33
jtmtv1817-Feb-03 19:33 
GeneralRe: Windows Form and Command Line Pin
Braincrash18-Feb-03 7:02
Braincrash18-Feb-03 7:02 
GeneralRe: Windows Form and Command Line Pin
jtmtv1818-Feb-03 11:28
jtmtv1818-Feb-03 11:28 
GeneralRe: Windows Form and Command Line Pin
Braincrash18-Feb-03 13:59
Braincrash18-Feb-03 13:59 
Generalchanging encryption password size Pin
jtmtv1817-Feb-03 15:22
jtmtv1817-Feb-03 15:22 
GeneralRe: changing encryption password size Pin
Furty17-Feb-03 17:01
Furty17-Feb-03 17:01 
GeneralRe: changing encryption password size Pin
jtmtv1817-Feb-03 19:31
jtmtv1817-Feb-03 19:31 
GeneralRe: changing encryption password size Pin
Furty18-Feb-03 9:40
Furty18-Feb-03 9:40 
GeneralRe: changing encryption password size Pin
jtmtv1818-Feb-03 12:10
jtmtv1818-Feb-03 12:10 
GeneralSecurity question Pin
Omega50117-Feb-03 13:30
Omega50117-Feb-03 13:30 
GeneralRe: Security question Pin
jtmtv1817-Feb-03 13:46
jtmtv1817-Feb-03 13:46 
GeneralRe: Security question Pin
Omega50117-Feb-03 14:07
Omega50117-Feb-03 14:07 
GeneralRe: Security question Pin
jtmtv1817-Feb-03 14:16
jtmtv1817-Feb-03 14:16 
GeneralRe: Security question Pin
Omega50117-Feb-03 15:21
Omega50117-Feb-03 15:21 
GeneralRe: Security question Pin
Furty17-Feb-03 16:55
Furty17-Feb-03 16:55 
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 

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.