You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Recent fix in pmap brought attention to this issue.
It is a common pattern that you start multiple worker threads, and later join them all. If one of thread-join! throws an error and we don't handle it, the remaining threads are left unjonied.
So the good way is to always catch exceptions and record them from thread-join! while iterating the list of worker threads, and once all are joined, handle the recorded exceptions. We can make that pattarn an API, say, thread-join-all!.
There are several possibilities regarding how to handle the caught exceptions.
thread-join-all! returns a list of results, and replace the thrown condition in place of the result.
Reraise any one of them after all threads are joined.
Reraise a compond condition of all of caught exceptions.
Call a callback.
The text was updated successfully, but these errors were encountered:
Recent fix in
pmap
brought attention to this issue.It is a common pattern that you start multiple worker threads, and later join them all. If one of
thread-join!
throws an error and we don't handle it, the remaining threads are left unjonied.So the good way is to always catch exceptions and record them from
thread-join!
while iterating the list of worker threads, and once all are joined, handle the recorded exceptions. We can make that pattarn an API, say,thread-join-all!
.There are several possibilities regarding how to handle the caught exceptions.
thread-join-all!
returns a list of results, and replace the thrown condition in place of the result.The text was updated successfully, but these errors were encountered: