gpt4 book ai didi

multithreading - Vibe.D 是多线程来处理并发请求的吗?

转载 作者:可可西里 更新时间:2023-11-01 16:51:39 25 4
gpt4 key购买 nike

我知道 Vibe.D 实现是基于 Fibers 的。但我不知道Vibe.D 处理高负载场景的能力如何。 Vibe.D 中的调度程序是在多个线程上分配纤程,还是仅在一个线程上分配所有纤程?

这一考虑非常重要,因为即使 Fibers 的效率很高,也会浪费大量 CPU 时间,最多只有一个线程用于处理所有传入请求。

最佳答案

他们的首页说是:

http://vibed.org/

这个页面有详细信息

http://vibed.org/features#multi-threading

Distributed processing of incoming connections

The HTTP server (as well as any other TCP based server) can be instructed to process incoming connections across the worker threads of the thread pool instead of in the main thread. For applications that don't need to share state across different connections in the process, this can increase the maximum number of requests per second linearly with the number of cores in the system. This feature is enabled using the HTTPServerOption.distribute or TCPListenOptions.distribute settings.

关于multithreading - Vibe.D 是多线程来处理并发请求的吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38173991/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com