Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: "Daniel Bünzli" <daniel.buenzli@epfl.ch>
To: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Has the thread cancellation problem evolved ?
Date: Mon, 27 Aug 2007 12:12:53 +0200	[thread overview]
Message-ID: <DA30783C-1478-432A-8AE3-C26B1ED05D41@epfl.ch> (raw)
In-Reply-To: <1188189497.11749.66.camel@rosella.wigram>


Le 27 août 07 à 06:38, skaller a écrit :

> That is a reasonable crude idea, but not precise because you haven't
> specified what 'should' happen to any acquired resources which would
> normally be released under program control.

They are left as is. If the programmer didn't care to handle, this is  
his problem, as when he forgets to close a file. The problem is if  
you don't even give the opportunity to the programmer to handle the  
problem, this is why Thread.kill is bad but Thread.raise_in acceptable.

> I cannot agree with that claim at this time. If a library
> acquires resources and should support cancellation, then the library
> must also make provision for relinquishing those resources,
> including on cancellation.

I think that in gc'd environment this problem is less acute. How many  
of the libraries out there are using locks or do fd business I don't  
know _under_ the module interface ? Any library that does not perform  
that kind of thing, and to overapproximate that does not bind to C,  
won't have a problem with cancellation. If their resource usage is  
explicit then I'm writing the resources allocation and deallocation  
and my thread will release them in the exception handler that I will  
write. I'll design and care for it.

Daniel

  reply	other threads:[~2007-08-27 10:12 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-25 13:58 Daniel Bünzli
2007-08-25 15:29 ` [Caml-list] " skaller
2007-08-26 23:47   ` Daniel Bünzli
2007-08-27  0:18     ` Till Varoquaux
2007-08-27  4:38     ` skaller
2007-08-27 10:12       ` Daniel Bünzli [this message]
2007-08-27 11:28         ` skaller
2007-08-27 11:49           ` Jon Harrop
2007-08-27 12:24           ` Daniel Bünzli
2007-08-27 12:38             ` Jon Harrop
2007-08-27 13:09               ` Daniel Bünzli
2007-08-27 14:27               ` skaller
2007-08-27  7:55     ` Markus E L
2007-08-27 23:33   ` Gerd Stolpmann
2007-08-28  9:26     ` Daniel Bünzli
2007-08-28 11:42       ` Gerd Stolpmann
2007-08-28 14:46         ` Daniel Bünzli
2007-08-28 14:23       ` Gordon Henriksen
2007-08-28 14:35         ` Brian Hurt
2007-08-28 14:44           ` Daniel Bünzli
2007-08-28 14:54           ` Robert Fischer
2007-08-28 15:12             ` Brian Hurt
2007-08-28 15:32               ` Gordon Henriksen
2007-08-28 15:40               ` skaller
2007-08-29  8:12               ` Lionel Elie Mamane
2007-08-28 15:00           ` Gordon Henriksen
2007-08-25 15:44 ` skaller
2007-08-26 23:24   ` Alain Frisch
2007-08-25 15:57 ` Gordon Henriksen

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=DA30783C-1478-432A-8AE3-C26B1ED05D41@epfl.ch \
    --to=daniel.buenzli@epfl.ch \
    --cc=caml-list@yquem.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