(locking resource (read/write)) sounds appropriate for such a resource
to me. Maybe you should do locking writes through an agent, and just
rely on locking for blocking reads. I don't really know how lock
requests are queued, is that why you are looking for more complicated
answers?

;; ugh this is ugly!!! I think using locking is more obvious
(defn send-off-and-wait
  [a f & args]
  (let [blocker (java.util.concurrent.LinkedBlockingQueue.)
        done-fn #(.add blocker (apply f % args))]
    (send-off a done-fn)
    (.take blocker)))


--~--~---------~--~----~------------~-------~--~----~
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