From: Ker Lutyn <ker527mail@yahoo.com>
To: caml-list@inria.fr
Subject: [Caml-list] file descriptor leaks?
Date: Mon, 3 May 2004 16:32:32 -0700 (PDT) [thread overview]
Message-ID: <20040503233232.83370.qmail@web40605.mail.yahoo.com> (raw)
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
next reply other threads:[~2004-05-03 23:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-05-03 23:32 Ker Lutyn [this message]
2004-05-04 7:46 ` Basile Starynkevitch local
2004-05-04 9:15 ` Henri DF
2004-05-04 9:31 ` Richard Jones
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040503233232.83370.qmail@web40605.mail.yahoo.com \
--to=ker527mail@yahoo.com \
--cc=caml-list@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox