GNU bug report logs - #79461
n-par-for-each do not propagate exceptions

Previous Next

Package: guile;

Reported by: Maxim Cournoyer <maxim <at> guixotic.coop>

Date: Wed, 17 Sep 2025 07:17:01 UTC

Severity: normal

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim <at> guixotic.coop>
To: bug-guile <bug-guile <at> gnu.org>
Subject: n-par-for-each do not propagate exceptions
Date: Wed, 17 Sep 2025 16:15:34 +0900
Hi,

The documentation of `n-par-for-each' (info "(guile) Parallel Forms")
does not mention that errors thrown in the procedure run in parallel are
absorbed, instead of relayed to the control code to be handled.

Here's an example:

--8<---------------cut here---------------start------------->8---
(use-modules (srfi srfi-26) (ice-9 threads))
(n-par-for-each 10 (cut error <>) '(a b c d e f g h i j))

;; Produces:

In thread:
In thread:In thread:a


b
In thread:
c
In thread:
d
In thread:
e
In thread:
f
In thread:
In thread:
h
g
In thread:
i
In thread:
j
--8<---------------cut here---------------end--------------->8---

The errors are printed but the exception does not cause the whole
program to be aborted.

This makes this (and I assume other similar) parallel forms unpractical
for situations where errors may happen and must be handled at the top
level.

-- 
Thanks,
Maxim




This bug report was last modified 2 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.