Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@abhijith
Created June 16, 2010 08:30
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abhijith/440331 to your computer and use it in GitHub Desktop.
Save abhijith/440331 to your computer and use it in GitHub Desktop.
(def x (ref 0)
(def agents (for [i (range 0 1000)] (agent x)))
(map #(send %1 (fn [x] (dosync (alter x inc)))) agents)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment