Re: Use Interlocked* functions

2005-01-10 Thread Joris Huizer
Mike Hearn wrote: On Mon, 10 Jan 2005 18:03:30 +0100, Joris Huizer wrote: Paul Vriens was posting patches in which references to This->ref in TRACE calls were replaced by a variable containing the value of This->ref - I can't remember why this was necessary, but I don't think he's doing it just

Re: Use Interlocked* functions

2005-01-10 Thread Rob Shearman
Mike McCormack wrote: The most important reason in my mind to do this is so that people implementing objects in the future copy code that uses the Interlocked* functions. There's no overhead to using those functions... no penalty if we use them in code that doesn't need to be thread safe, so w

Re: Use Interlocked* functions

2005-01-10 Thread Mike Hearn
On Mon, 10 Jan 2005 18:03:30 +0100, Joris Huizer wrote: > Paul Vriens was posting patches in which references to This->ref in > TRACE calls were replaced by a variable containing the value of > This->ref - I can't remember why this was necessary, but I don't think > he's doing it just for the fu

Re: Use Interlocked* functions

2005-01-10 Thread Mike Hearn
On Mon, 10 Jan 2005 22:42:22 +, Mike McCormack wrote: > Well, it's true that some objects don't need to be thread safe, however > it's not recorded anywhere in the Wine source which object need to be > thread safe and which don't. That info is usually available in MSDN or the registry. But I

Re: Use Interlocked* functions

2005-01-10 Thread Joris Huizer
Mike Hearn wrote: On Mon, 10 Jan 2005 11:38:20 +0100, Joris Huizer wrote: To see how far we are, I tried grepping to get This->refs stuff grep -r -n -e 'TRACE(.*This->ref)' * grep -r -n "++(This->ref)" * grep -r -n -- "--(This->ref)" * I hope there are a lot of false positives there :-/ You re

Re: Use Interlocked* functions

2005-01-10 Thread Mike McCormack
Mike Hearn wrote: To be quite honest I'm not convinced this janitorial task is a good idea. It makes the code look at first glance like it's thread safe when it actually isn't. A better janitorial task would simply be "Make free-threaded COM objects thread safe" except that making code thread safe

Re: Use Interlocked* functions

2005-01-10 Thread Mike Hearn
On Mon, 10 Jan 2005 11:38:20 +0100, Joris Huizer wrote: > To see how far we are, I tried grepping to get This->refs stuff > grep -r -n -e 'TRACE(.*This->ref)' * > grep -r -n "++(This->ref)" * > grep -r -n -- "--(This->ref)" * > > I hope there are a lot of false positives there :-/ You real

Use Interlocked* functions

2005-01-10 Thread Joris Huizer
To see how far we are, I tried grepping to get This->refs stuff grep -r -n -e 'TRACE(.*This->ref)' * grep -r -n "++(This->ref)" * grep -r -n -- "--(This->ref)" * I hope there are a lot of false positives there :-/ regards, Joris

Re: [QUARTZ] Use Interlocked* functions in AddRef and Release (RESEND)

2005-01-04 Thread Paul Vriens
On Tue, 2005-01-04 at 21:48, Alexandre Julliard wrote: > Paul Vriens <[EMAIL PROTECTED]> writes: > > > TRACE("(%p)->()\n", iface); > > -if (!--This->refCount) > > +if (!InterlockedDecrement(&This->refCount)) > > { > > CoTaskMemFree(This->ppFilters); > > CoTaskMe

Re: [QUARTZ] Use Interlocked* functions in AddRef and Release (RESEND)

2005-01-04 Thread Alexandre Julliard
Paul Vriens <[EMAIL PROTECTED]> writes: > TRACE("(%p)->()\n", iface); > -if (!--This->refCount) > +if (!InterlockedDecrement(&This->refCount)) > { > CoTaskMemFree(This->ppFilters); > CoTaskMemFree(This); You also need to store the result of the decrement and ha

Re: Changed files to use interlocked functions

2005-01-04 Thread Dimitrie O. Paun
On Tue, Jan 04, 2005 at 02:59:45PM +0100, Paul Vriens wrote: > Are there AddRef's or Releases that don't need the modification? Or is it > OK to modify all of them? I think it's OK to modify them all. > What's the best way to generate mail/patches for this bulk. One email for > each file/dll? Inl

Re: Changed files to use interlocked functions

2005-01-04 Thread Rob Shearman
Paul Vriens wrote: Hi Mike, Are there AddRef's or Releases that don't need the modification? Or is it OK to modify all of them? Theoretically, COM classes that are registered with "ThreadingModel"="Apartment" do not need to use the atomic increment/decrement functions as they shouldn't be a

Re: Changed files to use interlocked functions

2005-01-04 Thread Mike McCormack
Paul Vriens wrote: Are there AddRef's or Releases that don't need the modification? Or is it OK to modify all of them? I think it should be safe to do all of them. InterlockedIncrement is inline, so it shouldn't have any performance penalty. It may not strictly be necessary for objects in single

Re: Changed files to use interlocked functions

2005-01-04 Thread Paul Vriens
Hi Mike, > > > Paul Vriens wrote: > >> the Janitorial page shows that the "Use Interlocked functions in AddRef >> and Release methods" project is finished. >> >> There are however several files (at least 135) that still use the >> non-interloc

Re: Changed files to use interlocked functions

2005-01-04 Thread Mike McCormack
Paul Vriens wrote: the Janitorial page shows that the "Use Interlocked functions in AddRef and Release methods" project is finished. There are however several files (at least 135) that still use the non-interlocked method. Especially ddraw, d3*, dm*, avifil32 and some ole/oleaut32. Do

Changed files to use interlocked functions

2005-01-04 Thread Paul Vriens
Hi, the Janitorial page shows that the "Use Interlocked functions in AddRef and Release methods" project is finished. There are however several files (at least 135) that still use the non-interlocked method. Especially ddraw, d3*, dm*, avifil32 and some ole/oleaut32. Do they still