This is the mail archive of the cygwin-patches@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Probably unnecessary InterlockedCompareExchangePointer in List_remove in thread.h


On May 29 17:03, Vaclav Haisman wrote:
> 
> I think that the call to InterlockedCompareExchangePointer() can and should be
> replaced by ordinary if and assignment. The synchronization it provides doesn't
> seem to be necessary.

Are you sure the synchronization isn't necessary?  You just say you think
it isn't, but there's not much of a proof.  In any case, the call to
InterlockedCompareExchangePointer is looking quite expensive, but it isn't.
Did you notive there's a local file called winbase.h in the cygwin directory?
If you have a look, you'll see that InterlockedCompareExchangePointer
boils down to exactly one assembler instruction, so it doesn't seem to
be worth the effort, does it?


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          mailto:cygwin@cygwin.com
Red Hat, Inc.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]