JairoV
JairoV

Reputation: 2104

Can I dispatch Fibers over a threadPool in D

What I want is to gain the Fiber's high efficiency on context switching and yield CPU time during I/O, but when the workload is enough to feed more CPUs I would like to gain the performance from the fact of do things in parallel.

I read this great article about Threads and Fibers https://octarineparrot.com/article/view/getting-more-fiber-in-your-diet

And read this question regarding of comparison between fibers and threads. Fibers over Threads in D

But I want to get any light about a good way to mix them agnostic and gracefully. Of course, code samples are welcome.

Upvotes: 0

Views: 235

Answers (1)

DejanLekic
DejanLekic

Reputation: 19797

You can.

Quote from the documentation:

Please note that there is no requirement that a fiber be bound to one specific thread. Rather, fibers may be freely passed between threads so long as they are not currently executing.

Obviously you can use pool of threads to run your fibers.

Upvotes: 1

Related Questions