English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
RE: callcc/cps-style programming
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2000-12-14 (18:24)
From: Dave Berry <dave@k...>
Subject: RE: callcc/cps-style programming

I agree with you about the (lack of) utility of call/cc.  (Although my
agreement might stem from my complete inability to understand any program
that uses it.  It really is the functional equivalent of the goto -- in
several ways).

What caught my attention in your message was your comments about threads.
Several people have found lightweight threads to be useful in GUI libraries,
and in writing server programs (although for the latter application, OS
threads offer advantages on multi-processors).  Erlang has found success,
and Erlang programs use a huge number of lightweight threads/processes.

I would like to know more about the Ousterhout paper on events vs. threads.
Does this paper put Erlang on the "events" side of the distinction, or the
"threads" side?  I.e. does "events" refer to separate processes
communicating by sending values down channels, or to the sort of event loops
found in many GUI libraries (and which are central to Windows and OS/2)?
Please could you post the full citation (or even a URL) for the paper?



-----Original Message-----
From: Chet Murthy [mailto:chet@watson.ibm.com]
Sent: Saturday, December 09, 2000 18:49
Cc: Joe Lisp; caml-list@inria.fr
Subject: Re: callcc/cps-style programming 

As for lightweight threading, well, it's nice that you can implement
them with continuations, but the real purpose of threading is to
interface with some external source of events.  Every such source
(except for the lowest-level X windows protocol) requires operating
system-level thread-contexts, so you'll end up needing heavyweight
threads anyway.

Finally, well, as Ousterhout noted in his seminal paper on events
vs. threads, there are rarely any good reasons to use threads, if you
have sufficient abstraction power (closures!) in your language.