OCaml threads context switch example


/ Published in: Other
Save to your folder(s)

<p>this example checks that when the context switch occurs in the O'Caml runtime.
compile it with:</p>

<ol>
<li>ocamlc -vmthread -I +threads -I unix unix.cmxa threads.cmxa filename.ml</li>
<li>ocamlc -thread -I +threads -I unix unix.cmxa threads.cmxa filename.ml</li>
<li>ocamlopt -thread -I +threads -I unix unix.cmxa threads.cmxa filename.ml</li>
</ol>

<p>both 1. and 2. terminates, while 3. not (on my OCaml 3.11.1, on Mac OS X).</p>

<p><strong>See also:</strong><a href="http://snipplr.com/view/19509/">http://snipplr.com/view/19509/</a></p>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.