> Yes. I know, it was a question related to multithreaded programming.
My way of asking the question was wrong. I should have asked:
Do I need to guard the usage of g_pEvent by a SpinLock or do I need
to use some other synchronization construct ?
OR still better
Which synchronization mechanism shall I use ?
I was in a dilemma, should I use SpinLock or Mutex and
thought (as usual) to get it from the Gurus here.
Thanks, and sorry for a wrong question.
Abhijit
Hey, no need to be sorry - I just misunderstood the question… happens
every day
Seems the Gurus say MUTEX/FAST_MUTEX and I say SpinLock If it’s any
longer then ~100 CPU cycles you should probably really use a FAST_MUTEX.
If it’s just 1-2 “if’s” and 2-3 assignments then personally I’d use a
SpinLock without thinking twice because it’s easier and I still believe
it’s not-so-bad to block the system for 100 cycles.
I guess it really doesn’t matter since that piece of code probably won’t
execute a 100 times per second.
wrote in message news:xxxxx@ntdev… > > Yes. I know, it was a question related to multithreaded programming. > > My way of asking the question was wrong. I should have asked: > > Do I need to guard the usage of g_pEvent by a SpinLock or do I need > > to use some other synchronization construct ? > > OR still better > > Which synchronization mechanism shall I use ? > > I was in a dilemma, should I use SpinLock or Mutex and > > thought (as usual) to get it from the Gurus here. > > > > Thanks, and sorry for a wrong question. > > > > Abhijit > > Hey, no need to be sorry - I just misunderstood the question… happens > every day > Seems the Gurus say MUTEX/FAST_MUTEX and I say SpinLock If it’s any > longer then ~100 CPU cycles you should probably really use a FAST_MUTEX. > If it’s just 1-2 “if’s” and 2-3 assignments then personally I’d use a > SpinLock without thinking twice because it’s easier and I still believe > it’s not-so-bad to block the system for 100 cycles. > I guess it really doesn’t matter since that piece of code probably won’t > execute a 100 times per second. > > So make your choice > > Regards, > Paul Groke >