Thread runners Marc Nieper-Wißkirchen (10 Nov 2022 20:16 UTC)
Re: Thread runners Marc Nieper-Wißkirchen (11 Nov 2022 15:53 UTC)
Re: Thread runners John Cowan (14 Nov 2022 19:01 UTC)
Re: Thread runners Marc Nieper-Wißkirchen (14 Nov 2022 19:06 UTC)
Re: Thread runners John Cowan (18 Feb 2023 03:00 UTC)
Re: Thread runners Marc Nieper-Wißkirchen (18 Feb 2023 14:42 UTC)

Thread runners Marc Nieper-Wißkirchen 10 Nov 2022 20:16 UTC

Concerning the design of the thread runner facility, the following
needs to be resolved:

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. This can be helpful if the
timeout should depend on the current program state.

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?

3. The body of the thread runner procedure can be entered several
times, the typical problem in Scheme when trying to make things from
other languages work.  We could give a thread-running procedure
unprotect-wind semantics, not allowing reentering the dynamic extent,
but this could limit the facility's applicability.

4. What should happen when the thread runner is GC'd (e,g, because a
thread is abnormally terminated)? Should the registered threads be
terminated as well?

I would like to hear your opinions about these design issues.

Thanks,

Marc