Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 clojure 文档中,我看到代理使用线程池来处理数据。但我读到(总是在文档中):
所有代理的操作在线程池中的线程之间交错。在任何时间点,每个代理最多执行一个操作。
为什么代理有一个线程池而不是一个线程来处理发送函数的“队列”?
谢谢。
代理没有“线程池”。有两个线程池(forsend和send-off操作),代理操作被分配到其中。
send
send-off
这种设计决策是 CPU 密集型任务的最佳选择,也是 IO 密集型任务的最佳方法。
对于后一种情况,提供您自己的池send-via将是最佳选择(假设您知道自己在做什么)。
send-via