On 2017-10-20 08:40, Suliman wrote:

How runtime detect blocking operation? Is it's some auto-detection or programmer should call yield every time when he expect blocking operation.

The key here for vibe.d is that is to not use blocking operations. For
IO that means using asynchronous IO or non-block IO. That means when
calling "aio_read" or any other asynchronous operation it will
immediately return to the caller. The vibe.d runtime will check if data
is available, if it's not it will yield the fiber to allow other fibers
to run.

On the other hand, if a long running computation is performed, which is
not asynchronous, the whole thread will be blocked until it completes.

Ok, for example we got blocking operation (for example file-reading). The fiber is doing yield. But file reading can't be run in nowhere. It should be run in thread. But where is this thread?

The file operation is queued and performed in the operating system.

What is the difference between D and Go approche?

I would guess Go uses a similar approach.

/Jacob Carlborg