From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: References: Date: Wed, 19 Jan 2011 22:59:09 -0800 Message-ID: From: ron minnich To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [9fans] plan9 go output faults on 9vx with rfork Topicbox-Message-UUID: 9f657128-ead6-11e9-9d60-3106f5b1d025 OK, Pavel sent me a nice piece of code that implements cmpswap using a gcc trick. I did not want to use the trick for a few reasons, and thought to use futex instead, as it seemed appropriate. Weirdly enough, I can not find a simple implementation of cmpswap that uses futex, though I can find several papers describing how tricky futex is, and one Linux person who told me that futex had evolved in ways not necessarily to our advantage. Every time I'm ready to throw in the towel on Plan 9 and just go with Linux I hit something like futex and it's back into the fray ... :-) So, I have committed changes to my vx32 repo and Pavel's sieve now works on 9vx on a 32-bit linux vmware image. It should also work if you build on freebsd. It should also work if you build on 64-bit linux but there are no guarantees, since all this relies on some gcc builtins. You can see what I've done if you look at my repo. BTW, the sieve ran to 17xxx on linux and then I got some kind of malloc failure, I'll assume it's another 32-bit gc issue. I'm up to 57917 on osx. You're going to need Pavel's mods to go, I suppose. but that's another story ... ron