I hate to see agents used this way. If people want a thread pool they
should either use the ones provided by clojure, or create their own.
Using agents when you want a thread pool smacks of ignorance.

http://download.oracle.com/javase/6/docs/api/java/util/concurrent/ThreadPoolExecutor.html

You can tell when you should be using a threadpool/futures instead
agents when you don't use an agent as an identity over a series of
values.

On Sat, Sep 10, 2011 at 11:14 PM, Laurent PETIT <laurent.pe...@gmail.com> wrote:
> Hello,
> Would it make sense to use instead promise/deliver, and enque computations
> in order in agents queues ? (worse parallelism, but more control over the
> number of threads ?)
>
> 2011/9/10 Illim <illminou...@gmail.com>
>>
>> I'm a clojure beginner and from the future api , the only way I found
>> to create a future from another is to block the resulting future's
>> thread with 'deref'. I'm a little bit afraid of exhausting my thread
>> pool.
>> For example:
>> (def x (future 1))
>> (def y (future (+ 1 @x)))
>> y will block and consume a thread during x computation.
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clojure@googlegroups.com
>> Note that posts from new members are moderated - please be patient with
>> your first post.
>> To unsubscribe from this group, send email to
>> clojure+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with your
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en



-- 
And what is good, Phaedrus,
And what is not good—
Need we ask anyone to tell us these things?

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to