From: Andrew G. <ag...@em...> - 2001-04-03 06:06:22
|
James wrote: > I downloaded Zoolib yesterday and compiled the demos on Linux 2.4.2 > (Intel) and Solaris 8 (UltraSPARC). The demos run (ostensibly) fine > under Linux but crash (Segmentation fault) under Solaris. The problem > seems to be when ZAtomic_Add tries to acquire the sMutexNR lock: the > acquisition routine calls ZAtomic_Add...infinite recursion. It would > seem that when compiled on an Intel platform the ASM is used and is > correct (so the Linux build worked) but the C++ for non-PPC and > non-Intel platforms is incorrect (so the Solaris build failed). Hi James, Mike's protestations (and associated complement): >I would strongly disagree with you that there are logical errors in the C++ notwithstanding, you are correct that in the 0.8 source archive the 'dumb' version of the atomic operators is incorrect. It was something I put together as a placeholder as much as anything -- I didn't have a platform that actually needed it, so I never actually ran it. On a subsequent re-reading of the code my brain engaged: the implementation of sMutexNR is a benaphore, relying on atomic add to shortcircuit non-contested non-recursive mutex allocation. A fix is in place. The most recent code that I feel is in reasonable shape lives in <http://www.zoolib.org/bleedingedge/> I have not been posting announcements of updates to that directory, but in looking back over it, I've been updating it about once a month. Apps based on ZooLib have been built and run on Solaris, but it's been a while and the full suite of atomic ops has grown up since then (about two years ago). The atomic operations are fairly straightforward to port, although sparc is probably the most awkward target architecture. I'd love to work with you to get them in place. I really appreciate the time you, and everyone, have taken to grab the source and try it out. I encourage you all to post your findings to the list. I can't promise to fix every problem that's found, but I'll do my best to help out. A __________________________________________________________________ Andrew Green mailto:ag...@zo... ZooLib Guy http://www.zoolib.org 350 25th Avenue, Suite #1 Vox: +1 (415) 831 2471 San Francisco, CA 94121-1912 Fax: +1 (415) 831 2472 |