Re: question about atomics

2017-05-27 Thread joakim
lf. Dunno, sorry, I know how to do CAS > in C but not using this scheme procedure. You may need to look at the > implementation in the guile source to see how to use it correctly. > > If in doubt, you could always go back to using a mutex and a number, I > guess. Less efficient but it may be sufficient for your purposes. For some reason = worked here, I haven't delved further into it. The named let suggestion was also good thanks. In the end it turned out I also needed a mutex to synchronize output, so now I have both a mutex and an atomic for the same thing(a console progress indicator), which is kind of redundant I guess. Anyway, I learned new things about guile, so thanks again! > > -- Joakim Verona joa...@verona.se

Re: question about atomics

2017-05-26 Thread joakim
le > "compare and swap". I wound up with this, is there some better way to do this? Feels a bit verbose. (define (incatom atom) (let ((expected (atomic-box-ref atom))) (while (not (= expected (atomic-box-compare-and-swap! atom expected (+ 1 expected (set! expected (atomic-box-ref atom) > > > -- Joakim Verona joa...@verona.se

Re: question about atomics

2017-05-26 Thread joakim
I expected to be able to do the following: >> (atomic-box-swap! *msgcount* (lambda (atom) (+ 1 (atomic-box-ref >> atom > > That won't work. You have to use atomic-box-compare-and-swap!, in order > to detect interleaving by other threads. For more on this, google > "compare and swap". Thanks! > > > -- Joakim Verona joa...@verona.se +46705459454

question about atomics

2017-05-26 Thread joakim
es atomics? I think I expected to be able to do the following: (atomic-box-swap! *msgcount* (lambda (atom) (+ 1 (atomic-box-ref atom -- Joakim Verona joa...@verona.se

Re: Guile-Emacs update

2013-07-31 Thread joakim
em > support parallel compilation (couldn't you run "make -j4" or whatever's > appropriate for your system to get a nice speedup)? > I think the slowness was during lisp compilation, and that didnt use to benefit from parallel compilation. I might try again though. -- Joakim Verona

Re: Guile-Emacs update

2013-07-31 Thread joakim
me, much more than a normal emacs ./autogen.sh && ./configure && make The build took 53 minutes including the time to clone the first time. The second time took only a couple of minutes. This was on a fairly beefy machine. m-x tetris, and m-x zone worked fine! (eval-scheme "(

Re: gnome-clutter + repl?

2011-09-27 Thread joakim
l...@gnu.org (Ludovic Courtès) writes: > Hi Joakim! > > joa...@verona.se skribis: > >> Anyway, the problem is that clutter needs its own event loop, >> clutter-main, so then I can't simply use the Guile REPL as I'd like. > > Maybe you could start a RE

gnome-clutter + repl?

2011-09-24 Thread joakim
tried different ways to interface to Clutter from Guile. I hacked guile-clutter until it compiled but then it didn't want to runtime link. I tried Sbank, but it didn't work with guile. I also tried guile-gir, but it didn't work too well either. So until any of these other approaches pan out I can embedd guile. -- Joakim Verona