Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Function forward declaration?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Ville-Pertti Keinonen <will@e...>
Subject: Re: [Caml-list] Function forward declaration?

On Apr 7, 2004, at 4:52 PM, skaller wrote:

> On Wed, 2004-04-07 at 16:01, Nicolas Cannasse wrote:
>> And what would this code do ?
>>
>> let f () = while true do () done
>
> It blocks a thread. Not even marginally stupid,
> a very common and correct construction at the heart
> of every operating system, it even has a name "wait loop".

Minor nit - you probably mean "idle thread"...and it really isn't 
currently common in the above form, since most modern CPUs are halted 
when idle (although in some cases - SMP, where the wakeup might come 
from another CPU rather than an interrupt - it might be preferable to 
poll something for better wakeup latency).

> *** This isn't a dumb question. Sophisticated algorithms
> can chase down uninitialised values. The question is,

I'd expect (but haven't attempted to prove) detecting uninitialized 
values to be equivalent to the halting problem, so there would 
inevitably be cases that would need to be rejected, detected at 
run-time or result in unsound programs.

-------------------
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