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

Reply via email to