On Thu, Nov 10, 2022 at 3:16 PM Marc Nieper-Wißkirchen <
[email protected]> wrote:

1. John, you suggested adding an optional timeout parameter to
> `with-thread-runner'.  It may be better to add an optional thunk
> argument that is called when the thread runner procedure returns. The
> thunk is supposed to return a timeout.
>

I don't understand this at all.  First of all, I don't know what you mean
by a thread-runner procedure.  There is the procedure `with-thread-runner`,
which returns when its threads have terminated normally or abnormally.  It
passes a thread-runner object (a container for threads) to its body thunk,
whose purpose is to start threads and register them with the thread-runner
object.  So with-thread-runner actually needs to wait until its registered
threads terminate *and* the body thunk (which runs in the same thread as
with-thread-runner) has returned.


> 2. If a timeout happens, what should be the return values for the
> threads that didn't finish in time? Or no particular return value and
> let the following thread-join! with a timeout of 0 detect it?
>

They should be terminated with a timeout exception.  No thread-join is
needed, because that's what thread-runners do.


>

Reply via email to