Re: A new Critical Section for high contention situations



Kürsat wrote:
Keith,
Thank you for your comments. I am not agree with you about your claims below :

You said "there is no synchroniztion", then, what does synchronization mean? AFAIK, synchronization means "accepting only one thread to access certain resource or functionality at a time". My object achive this, so, I think, there is synchronization.

You said "there is no contention", then what does contention mean? AFAIK, contention (in the current context) means "more than one thtread to attemp to access certain resource or functionality at the same time". While using my object, this condition is highly possible, so "there is contention".

You mentioned "race conditions" but, race conditions occurs on resources not on synchronization objects.

Please correct me if I am in the wrong. I don't claim that this short implementation is correct but your arguments are contradictory with my knowledge.

Consider the following sequence of events:

Thread A owns the lock (m_nLock == OWNED).

Thread B calls enter().

Thread B's InterlockedCompareExchange() returns OWNED, so Thread B calls Sleep(0).

Thread B's Sleep(0) call returns before Thread A calls leave().

Thread B's call to enter() returns.

At this point, Thread A owns the lock, but Thread B "thinks" it owns the lock.
.



Relevant Pages

  • Re: A new Critical Section for high contention situations
    ... synchronization means "accepting only one thread to access certain resource or functionality at a time". ... You said "there is no contention", ... contention means "more than one thtread to attemp to access certain resource or functionality at the same time". ... You mentioned "race conditions" but, race conditions occurs on resources not on synchronization objects. ...
    (microsoft.public.win32.programmer.kernel)
  • Re: A new Critical Section for high contention situations
    ... void enter ... You said "there is no synchroniztion", then, what does synchronization ... You said "there is no contention", ... You mentioned "race conditions" but, ...
    (microsoft.public.win32.programmer.kernel)
  • Re: What happened to computer architecture (and comp.arch?)
    ... synchronization models at lest BigO(n**2) in time? ... It is _easy_ to provide sync when contention is zero, it is _hard_ to do the same when lots of cores/threads tries to do it simultaneously. ... Each thread could use a hash of its thread ID to determine which first-level lock to use. ...
    (comp.arch)
  • Re: A new Critical Section for high contention situations
    ... my tests was done using correct code. ... You said "there is no synchroniztion", then, what does synchronization ... You said "there is no contention", ... At this point, Thread A owns the lock, but Thread B "thinks" it owns the ...
    (microsoft.public.win32.programmer.kernel)
  • Re: A new Critical Section for high contention situations
    ... You said "there is no synchroniztion", then, what does synchronization mean? ... You said "there is no contention", ... to access certain resource or functionality at the same time". ... You mentioned "race conditions" but, race conditions occurs on resources not ...
    (microsoft.public.win32.programmer.kernel)

Loading