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
Has the thread cancellation problem evolved ?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-08-26 (23:47)
From: Daniel_Bünzli <daniel.buenzli@e...>
Subject: Re: [Caml-list] Has the thread cancellation problem evolved ?

Le 25 août 07 à 17:29, skaller a écrit :

> There is something I don't understand here.

What you don't understand is that ocaml has a runtime system which  
leaves some room for designing around what exists at the os level.

> If the source of the problem is a blocking operation, the solution
> is simple: don't use blocking operations!

This is not the source of the problem. What I want is to allow users  
to initiate and cancel computations whenever they want. Computations  
can be lengthy even tough they do not invoke a blocking operation.

The problem is that libraries are not -- and should not -- be  
designed with cancellation in mind, say every function has an  
optional parameter that allows to stop the computation. Cancellation  
should be a service of the runtime system, and denying its usefulness  
because it could be misused makes no sense, I can also open a file  
and never close it, it is a matter of programming discipline.