This is the mail archive of the
cygwin-patches@cygwin.com
mailing list for the Cygwin project.
Re: Probably unnecessary InterlockedCompareExchangePointer in List_remove in thread.h
- From: Corinna Vinschen <corinna-cygwin at cygwin dot com>
- To: cygwin-patches at cygwin dot com
- Date: Mon, 30 May 2005 12:53:13 +0200
- Subject: Re: Probably unnecessary InterlockedCompareExchangePointer in List_remove in thread.h
- References: <20050529165435.H81503@logout.sh.cvut.cz>
- Reply-to: cygwin-patches at cygwin dot com
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.