clojure - Why do agents have a pool of threads? -
in clojure documentation see agent use pool of thread process data. read (always in documentation) :
the actions of agents interleaved amongst threads in thread pool. @ point in time, @ 1 action each agent being executed.
why agent have pool of thread , not single thread process "queue" of sended function ?
thanks.
an agent not 'have pool of threads'. there 2 thread pools (for send
, send-off
actions), agent actions assigned.
this design decision optimal choice cpu-bound tasks, , best-effort approach io-bound tasks.
for latter case, providing own pool send-via
optimal choice (assuming know you're doing).
Comments
Post a Comment