first attempt at ocaml. uses Thread + Event.