From: <pa...@id...> - 2005-02-16 05:58:19
|
> Hmmm. I just started writing directions on how to browse the cvs > repository, how to check out etc, and in checking my instructions I > find that nothing's working. It looks like sourceforge is having some > difficulties. In the meantime I'm sending you current copies of > ZAtomic.cpp/h in a separate message. Ah, that would explain things, thanks! > I'm afraid I don't know of differences between VC++ 6-ish and VS 2005 > that would account for the problems in compiling the assembly code -- > it may be that it's stricter in its interpretation of mnemonics, and > perhaps the cmpxchg instructions have their operands the wrong way > round. I haven't used VC++ et al for years, and nor are any of my > current colleagues so ZooLib support for MS dev tools relies on helpful > souls pitching in from time to time. Gotcha. > wrt smart pointers in general -- the boost library has come on a long > way in the last few years, and their smart_ptr will likely be in the > next version of the standard library. It's not thread-safe, but might > suffice for your purposes. Generally, unless you're assigning *to* a > shared smart pointer you only need to update the count manipulation > with atomic ops. If you are assigning to a shared smart pointer it's > often better to simply protect it with some synchronization entity -- > it's possible to update a couple of pointers and an associated count > safely on PPC using address reservation instructions, and apparently > it's also possible on x86, but I suspect it'll need some post Pentium I > instruction to do so. Ah, I think I see what they were talking about on the boost list now when they said smart_ptrs are not thread safe, would I be right in thinking a ZRef would also need synchronization when assigning? I was hoping to find a reallysmart_ptr I could just use without having to worry about, do you have any recommendations? I`d happily trade some speed in the non speed critical parts of my software if it reduced the amount of time I spent debugging multithreaded issues. Thanks, Paul Nolan, CEO Idruna Software Inc. http://www.idruna.com |