I have a program using futures.
It runs very well with DrRacket 8.4 cs.
With DrRacket 8.4 bc it seems to use one processor only.
Is this a known problem?
If not I can send the source code (about 500 lines)
One of the advantages of Racket CS is that more operations are future-safe. See the discussion in racket/racket/src/thread/README.txt for more information.
Thanks Ryan,
That may explain things, although I don't see any unsafe operations in my code
(proper lists and exact integers only)
(no mutable objects, no hashes, no mpairs, no vectors, no boxes, no semaphores, no etc)
Jos
It means it's blocking on the + operation. IIUC, in Racket BC + is only future-safe if it is inlined by the JIT and if only the fast (fixnum-only) path is executed.
In my experiments, using + in a higher-order way caused the future to block; for example: (foldl + 0 xs). When I rewrote that to (foldl (lambda (a b) (+ a b)) 0 xs) then the future did not block. I had hoped that the compiler would inline foldl and put + in a direct-call position so the JIT can inline it, but it didn't. (Tested on Racket BC 8.1.)