caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* RE: callcc/cps-style programming
@ 2000-12-13 13:44 Dave Berry
  2000-12-13 16:36 ` Chet Murthy
  0 siblings, 1 reply; 13+ messages in thread
From: Dave Berry @ 2000-12-13 13:44 UTC (permalink / raw)
  To: Chet Murthy, STARYNKEVITCH Basile; +Cc: caml-list

Chet,

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?

Thanks,

Dave.



-----Original Message-----
From: Chet Murthy [mailto:chet@watson.ibm.com]
Sent: Saturday, December 09, 2000 18:49
To: STARYNKEVITCH Basile
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.



^ permalink raw reply	[flat|nested] 13+ messages in thread
* Re: callcc/cps-style programming
@ 2000-12-14 19:08 forsyth
  0 siblings, 0 replies; 13+ messages in thread
From: forsyth @ 2000-12-14 19:08 UTC (permalink / raw)
  To: caml-list

Ousterhout's paper on the dangers of threading was remarkable
for failing even to mention years of research by Hoare and Milner
(amongst others) into much better ways of programming concurrent
applications than either 1960s style wait/notify style or 1970s monitors.
occam, Erlang and others applied the new techniques quite successfully.
Of course, the whole point of developing the techniques was to
address the problems listed in Ousterhout's paper!

>>Period.  But user-level threads, implemented in the language, don't
>>give you much value.  Much better to do some sort of explicit (perhaps
>>semi-automated) CPS-conversion, and use an event-dispatcher.

One reason for using them (and concurrent programming) is
simpler and clearer programs than the rats' nest that often
results from call backs and other attempts to emulate proper processes.



^ permalink raw reply	[flat|nested] 13+ messages in thread
* callcc/cps-style programming
@ 2000-12-06 20:13 Joe Lisp
  2000-12-07  8:31 ` STARYNKEVITCH Basile
  2000-12-08 10:50 ` Xavier Leroy
  0 siblings, 2 replies; 13+ messages in thread
From: Joe Lisp @ 2000-12-06 20:13 UTC (permalink / raw)
  To: caml-list

Is anyone working on callcc for OCaml?

If the answer is no, and I want to use lightweight
threads, I can program in CPS to make my own
(non-preemptive) thread system.  Would large programs
written in CPS incur any particular extra overhead
from the current OCaml compiler/runtime?

An unrelated question: suppose I have some combinators
or whatnot that I use all the time.  If they are in
their own file, then I assume I pay a
cross-compilation module penalty every time I use
them.  Is there a way to #include them instead?

Thanks!


__________________________________________________
Do You Yahoo!?
Yahoo! Shopping - Thousands of Stores. Millions of Products.
http://shopping.yahoo.com/



^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2000-12-18 14:45 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-12-13 13:44 callcc/cps-style programming Dave Berry
2000-12-13 16:36 ` Chet Murthy
2000-12-14 19:20   ` T. Kurt Bond
2000-12-15 13:31     ` Martin Berger
2000-12-15 18:37   ` Julian Assange
2000-12-15 23:10     ` Chet Murthy
  -- strict thread matches above, loose matches on Subject: below --
2000-12-14 19:08 forsyth
2000-12-06 20:13 Joe Lisp
2000-12-07  8:31 ` STARYNKEVITCH Basile
2000-12-09  3:58   ` eijiro_sumii
2000-12-09 18:48   ` Chet Murthy
2000-12-12 17:14     ` John Max Skaller
2000-12-08 10:50 ` Xavier Leroy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).