English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
memory usage
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2009-01-12 (16:44)
From: John Lepikhin <john@i...>
Subject: Re: [Caml-list] memory usage

> > Each thread is killed after work is done
> How do you "kill" the threads? I hope this is just a figure of
> speech for "I do an orderly shutdown of each thread after work is done."

Well, that was consequence of my bad English :-) Threads finish their
work and exit. I also made a simple wrapper to Thread.create to be sure
that all work inside threads is done:

module MyThread =
  let create f p =
    let dowork _ =
      (* log thread creation *)
      f p;
      (* log thread shutdown *)
    in
    Thread.create dowork ()
end