Probably unnecessary InterlockedCompareExchangePointer in List_remove in thread.h

Christopher Faylor cgf-no-personal-reply-please@cygwin.com
Mon May 30 18:33:00 GMT 2005


On Mon, May 30, 2005 at 08:00:52PM +0200, Vaclav Haisman wrote:
>I am not sure, that is why I wrote "probably". But from what I see there is
>already exclusive access guaranteed by the mx.lock() call, unless of course I
>am completely misunderstanding something.

I don't think you are.  I missed this too when I saw your patch and had
the same reaction that Corinna did.

I think this patch should be ok to apply.

>I can tell you that "lock; cmpxchg" pair of instruction is really not as cheap
>as it looks. Especially on SMP systems. It takes above 100 of cycles on
>contemporary CPUs.

Do you have a reference which states this?  100s of cycles sounds like an
incredible amount of overhead.

cgf



More information about the Cygwin-patches mailing list