On Thu, 23 Mar 2017 20:37:01 +0100, Sönke Ludwig wrote:

Maybe it would have been a better idea to create two differently named
functions to make the mechanics more explicit.

The way it works now is that there are two flavours of async: one that
works in a different thread and one that works in the calling thread.
The choice gets made based on the type of the callback - only if it can
be safely called within a different thread (function or shared <br>delegate, with parameters that can be passed between threads), it will.

So there is one that runs in a thread! OK, now I look at runWorkerTask as opposed to runTask in the API, it becomes clear. It says "thread". Well, at least D Web Development wasn't out-and-out false about this.

I agree with you that this is better dealt with by two differently named functions, because right now, silently, one may be calling the Fiber version thinking one has an independent thread. The results are very different!

I suppose there's code that relies upon async in its present bifurcating form. Could you add a new function that forces weak isolation where needed e.g. via copying, and always uses a thread? Is this a good idea?