(************************************************************ not_sequential.ml Created : Wed Nov 12 23:49:31 2003 Last modified: Thu Nov 13 00:39:10 2003 Compile: ocamlc -thread -dtypes unix.cma /usr/local/lib/ocaml/threads/threads.cma not_sequential.ml -o not_sequential # FTP Directory: sources/ocaml # ************************************************************) (** @author Takashi Masuyama *) let _ = let i = ref 0 in let rec f n = if n = 0 then () else begin print_int !i; print_newline (); incr i; f (n-1); end in let t1 = Thread.create f 10 in let t2 = Thread.create f 10 in List.iter Thread.join [t1; t2] ;;