Click here to Skip to main content
15,922,696 members
Home / Discussions / C#
   

C#

 
AnswerRe: socket-client Pin
Vikram A Punathambekar6-Dec-05 21:59
Vikram A Punathambekar6-Dec-05 21:59 
GeneralRe: socket-client Pin
Ankit Aneja6-Dec-05 22:31
Ankit Aneja6-Dec-05 22:31 
QuestionSynchronization Require inStatic Function Call! Pin
majidbhutta6-Dec-05 17:54
majidbhutta6-Dec-05 17:54 
AnswerRe: Synchronization Require inStatic Function Call! Pin
S. Senthil Kumar7-Dec-05 1:33
S. Senthil Kumar7-Dec-05 1:33 
GeneralRe: Synchronization Require inStatic Function Call! Pin
majidbhutta7-Dec-05 3:33
majidbhutta7-Dec-05 3:33 
GeneralRe: Synchronization Require inStatic Function Call! Pin
S. Senthil Kumar7-Dec-05 4:12
S. Senthil Kumar7-Dec-05 4:12 
GeneralRe: Synchronization Require inStatic Function Call! Pin
majidbhutta7-Dec-05 4:26
majidbhutta7-Dec-05 4:26 
GeneralRe: Synchronization Require inStatic Function Call! Pin
S. Senthil Kumar7-Dec-05 4:35
S. Senthil Kumar7-Dec-05 4:35 
If you lock each function call, then at any point in time, only one thread could be executing a function. Which is what you want, so yes, it works. But there is a difference between the behavior of
private void MyDlg(---,--,---)
{
  lock(syncObject)
  {
   Componet.St_F4(--);
   Componet.St_F1(--,--,---);
    Componet.St_F3(---,--);
   }
}

and your code. The code above makes sure that at one point, only one thread can execute the whole sequence of functions (F4, F1, F3...). So if you have two threads, they will run like
Thread1
-------
Component.ST_F4
Component.ST_F3
Component.ST_F1

Thread2
-------
Component.ST_F4
Component.ST_F3
Component.ST_F1

With your code, the behaviour *could* be
Thread1
-------
Component.ST_F4

Thread2
-------
Component.ST_F4

Thread1
-------
Component.ST_F3
Component.ST_F1

Thread2
--------
Component.ST_F3
Component.ST_F1


Or in any order. If you're fine with that, go ahead.

Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
GeneralRe: Synchronization Require inStatic Function Call! Pin
majidbhutta7-Dec-05 5:07
majidbhutta7-Dec-05 5:07 
QuestionI don't want to display Relation name on DataGrid Pin
dhtuan6-Dec-05 16:21
dhtuan6-Dec-05 16:21 
QuestionTreeView CheckBoxes, but not their children Pin
meatago6-Dec-05 14:28
meatago6-Dec-05 14:28 
QuestionSkeleton Key Cryptography Pin
MrEyes6-Dec-05 13:10
MrEyes6-Dec-05 13:10 
AnswerRe: Skeleton Key Cryptography Pin
Paul Conrad6-Dec-05 13:57
professionalPaul Conrad6-Dec-05 13:57 
QuestionHard Drive Firmware Serial Number Pin
theladsmith6-Dec-05 11:03
theladsmith6-Dec-05 11:03 
QuestionLocalizable application Pin
machocr6-Dec-05 10:36
machocr6-Dec-05 10:36 
AnswerRe: Localizable application Pin
lmoelleb6-Dec-05 20:45
lmoelleb6-Dec-05 20:45 
GeneralRe: Localizable application Pin
machocr7-Dec-05 3:10
machocr7-Dec-05 3:10 
AnswerRe: Localizable application Pin
softwareguy12-Apr-06 3:57
softwareguy12-Apr-06 3:57 
Questiontyped datset Pin
fmardani6-Dec-05 10:24
fmardani6-Dec-05 10:24 
QuestionSharepoint Pin
.NetRocker6-Dec-05 10:17
.NetRocker6-Dec-05 10:17 
AnswerRe: Sharepoint Pin
Curtis Schlak.6-Dec-05 14:07
Curtis Schlak.6-Dec-05 14:07 
QuestionShort Message Service Pin
mlheese6-Dec-05 10:08
mlheese6-Dec-05 10:08 
QuestionMDI Applications?? Pin
HahnTech6-Dec-05 9:33
HahnTech6-Dec-05 9:33 
QuestionWindows Media Player EndOfStream Pin
sasdav6-Dec-05 9:33
sasdav6-Dec-05 9:33 
AnswerRe: Windows Media Player EndOfStream Pin
jawad marji6-Dec-05 22:33
jawad marji6-Dec-05 22:33 

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.