Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

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 Archives:
Bug reports: FAQ:
Beginner's list: