Click here to Skip to main content
15,891,136 members
Home / Discussions / C#
   

C#

 
Questionproblem in setting backround image to a form created using OpenGL in c# Pin
raesa15-Apr-09 1:34
raesa15-Apr-09 1:34 
Questionhow to write string in PDF Pin
wasimsharp15-Apr-09 1:10
wasimsharp15-Apr-09 1:10 
AnswerRe: how to write string in PDF Pin
stancrm15-Apr-09 1:18
stancrm15-Apr-09 1:18 
GeneralRe: how to write string in PDF Pin
wasimsharp15-Apr-09 18:23
wasimsharp15-Apr-09 18:23 
AnswerRe: how to write string in PDF Pin
tom57200715-Apr-09 2:56
tom57200715-Apr-09 2:56 
Questionmultithreading: lock (static) function library Pin
rpm820015-Apr-09 0:58
rpm820015-Apr-09 0:58 
AnswerRe: multithreading: lock (static) function library Pin
Moreno Airoldi15-Apr-09 3:22
Moreno Airoldi15-Apr-09 3:22 
AnswerRe: multithreading: lock (static) function library Pin
PIEBALDconsult15-Apr-09 6:29
mvePIEBALDconsult15-Apr-09 6:29 
rpm8200 wrote:
I need to make sure that my static function library is locked if one of the threads executes read or write operations


It's my understanding that static methods are always thread safe. That if thread 1 is executing Read then thread 2 will have to wait if it calls Read.

If you want thread 2 to wait if it calls Write while thread 1 is executing Read, then simply create an object to lock on:

private static readonly object lockme = new object() ;


Then in each of your methods:

lock ( lockme ) { ... }


I don't think I've ever had to do that in static methods, but I expect it will work.
GeneralRe: multithreading: lock (static) function library Pin
rpm820015-Apr-09 22:56
rpm820015-Apr-09 22:56 
QuestionSQL Script Pin
kibromg15-Apr-09 0:54
kibromg15-Apr-09 0:54 
AnswerRe: SQL Script Pin
tom57200715-Apr-09 0:57
tom57200715-Apr-09 0:57 
GeneralRe: SQL Script Pin
kibromg15-Apr-09 1:06
kibromg15-Apr-09 1:06 
GeneralRe: SQL Script Pin
kibromg15-Apr-09 1:16
kibromg15-Apr-09 1:16 
GeneralRe: SQL Script Pin
Skymir15-Apr-09 2:35
Skymir15-Apr-09 2:35 
AnswerRe: SQL Script Pin
Dino Mulahusic15-Apr-09 1:05
professionalDino Mulahusic15-Apr-09 1:05 
GeneralRe: SQL Script Pin
kibromg15-Apr-09 1:07
kibromg15-Apr-09 1:07 
GeneralRe: SQL Script Pin
Dino Mulahusic15-Apr-09 1:09
professionalDino Mulahusic15-Apr-09 1:09 
GeneralRe: SQL Script Pin
kibromg15-Apr-09 1:13
kibromg15-Apr-09 1:13 
GeneralRe: SQL Script Pin
Ashfield15-Apr-09 1:24
Ashfield15-Apr-09 1:24 
GeneralRe: SQL Script Pin
kibromg15-Apr-09 1:57
kibromg15-Apr-09 1:57 
GeneralRe: SQL Script Pin
Ashfield15-Apr-09 9:44
Ashfield15-Apr-09 9:44 
GeneralRe: SQL Script Pin
a.hamidy15-Apr-09 1:26
a.hamidy15-Apr-09 1:26 
AnswerRe: SQL Script Pin
Christian Graus15-Apr-09 1:27
protectorChristian Graus15-Apr-09 1:27 
GeneralRe: SQL Script Pin
kibromg15-Apr-09 1:58
kibromg15-Apr-09 1:58 
GeneralRe: SQL Script Pin
kibromg15-Apr-09 2:22
kibromg15-Apr-09 2:22 

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.