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
[Caml-list] file descriptor leaks?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-05-03 (23:32)
From: Ker Lutyn <ker527mail@y...>
Subject: [Caml-list] file descriptor leaks?
Suppose the central loop of my server looks like this:

while true do
  let fd, _ = Unix.accept sock in
  ignore (Thread.create f fd)

Assuming f does not close the fd when it's done, is this a fd leak? And is this

while true do
  let fd, _ = Unix.accept sock in
  let g fd = try f fd; Unix.close fd with e -> Unix.close fd; raise e in
  ignore (Thread.create g fd)

Thanks -

Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs  

To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners