From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id BAA12348; Tue, 4 May 2004 01:32:35 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id BAA11993 for ; Tue, 4 May 2004 01:32:34 +0200 (MET DST) X-SPAM-Warning: Sending machine is listed in blackholes.five-ten-sg.com Received: from web40605.mail.yahoo.com (web40605.mail.yahoo.com [66.218.78.142]) by concorde.inria.fr (8.12.10/8.12.10) with SMTP id i43NWXSH012322 for ; Tue, 4 May 2004 01:32:33 +0200 Message-ID: <20040503233232.83370.qmail@web40605.mail.yahoo.com> Received: from [63.195.80.23] by web40605.mail.yahoo.com via HTTP; Mon, 03 May 2004 16:32:32 PDT Date: Mon, 3 May 2004 16:32:32 -0700 (PDT) From: Ker Lutyn Subject: [Caml-list] file descriptor leaks? To: caml-list@inria.fr MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Miltered: at concorde with ID 4096D691.002 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; descriptor:01 sock:01 sock:01 $20,000:99 unix:02 unix:02 leaks:02 thread:02 thread:02 suppose:03 let:04 let:04 raise:05 loop:06 career:91 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Suppose the central loop of my server looks like this: while true do let fd, _ = Unix.accept sock in ignore (Thread.create f fd) done Assuming f does not close the fd when it's done, is this a fd leak? And is this better? 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) done Thanks - __________________________________ Do you Yahoo!? Win a $20,000 Career Makeover at Yahoo! HotJobs http://hotjobs.sweepstakes.yahoo.com/careermakeover ------------------- 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