Thank you sir, no doubt futures are being used in an unsafe manner. The code 
was used in language benchmarks and was 'optimized' to squeeze every ounce of 
performance. What I find strange is that it does work well, and saturates all 
cores (that was the intent) on Win10, but crashes randomly on certain systems 
and certain versions of Racket. It believe it started becoming unstable around 
Racket 7.0. On Linux it only uses one thread, which could very well be caused 
by a difference in the way futures are implemented on Linux.

Dex

-----Original Message-----
From: racket-users@googlegroups.com <racket-users@googlegroups.com> On Behalf 
Of George Neuner
Sent: Monday, May 4, 2020 4:03 AM
To: racket-users@googlegroups.com
Subject: [racket-users] Re: Futures + threads SIGSEGV

On Sat, 2 May 2020 14:10:19 +0200, Dexter Lagan <dexterla...@gmail.com> wrote:

> I’ve been getting inconsistent results as well. A while ago I made a 
>benchmark based on a parallel spectral norm computation. The benchmark 
>works fine on Windows on most systems and uses all cores, but crashes 
>randomly on other systems. I haven’t been able to figure out why. On 
>Linux it doesn’t seem to use more than one core. I’d be interested to 
>know if this is related. Here’s the benchmark code :
>
>https://github.com/DexterLagan/benchmark
>
>Dex

I haven't examined the code in detail, but I suspect you're not giving the 
futures time to do anything.  Your 'for/par' function touches them almost 
immediately, and touching forces a future to be evaluated by the thread that 
has touched it.

Also be aware that futures essentially are limited to data access and math ... 
in particular if you try to do any kind of I/O within a future it will force 
(at least) that future into serial execution.

George

--
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/i2tuafl9rs29bjlr9i6rb387bdqj02epqg%404ax.com.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/00bd01d621e4%24968e8130%24c3ab8390%24%40gmail.com.

Reply via email to