Hi,

I'm not very familiar with the concurrent features
of Clojure myself. So I can't really comment on your
solution. I tried to solve the problem myself, though.
So here is my try:
http://paste.pocoo.org/show/115929

My solution to the "prefer reindeers" problem is a
global atom *preparing*. While this is true the
reindeers have not returned, yet,  and the elves are
still preparing. As soon as the last reindeer returns
Santa's marshall toggles this atom, which has
two effects:

First Edna stops accepting new elves for signing
up to see Santa. However there might be already
more elve "packages" in the queue of the Santa
agent. So Santa also checks the global atom and
ignores any elves in his agent queue until the
reindeer comes to pick him up. Is this cheating?

This whole process works with one atom and
only agents otherwise.

Sincerely
Meikel

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to