Skip to content

Instantly share code, notes, and snippets.

@kiwanami
Created April 18, 2011 04:11
Show Gist options
  • Select an option

  • Save kiwanami/924799 to your computer and use it in GitHub Desktop.

Select an option

Save kiwanami/924799 to your computer and use it in GitHub Desktop.
(require 'concurrent)
(lexical-let ((count 10)
(task-a (lambda () (insert "A")))
(task-b (lambda () (insert "B"))))
(cc:thread
1000
(while (< 0 (decf count))
(funcall (if (= 0 (% count 2)) task-a task-b)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment