caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* CallCC using fork (and garbage collected processes)
@ 2007-07-16  5:30 Jon Harrop
  2007-07-16  6:07 ` [Caml-list] " skaller
  0 siblings, 1 reply; 5+ messages in thread
From: Jon Harrop @ 2007-07-16  5:30 UTC (permalink / raw)
  To: caml-list


Just another crazy idea. So Oleg's callcc for OCaml works by copying the OCaml 
bytecode stack and its rather nifty because you can trivially control invert 
parsers and so forth.

You can replicate the native-code stack using fork. What if you wrap the 
forked process in an object and set the finalizer to pass it a message 
telling it to die. Then you could invoke the process (continuation) to 
propagate computation. Maybe you can pass your child the pipe from your 
parent so that it can respond directly and then die yourself (a tail call!).

I know this is really silly because you've got the OCaml GC collecting 
processes (which is even worse than GCing OpenGL textures) but my machine can 
fork processes pretty quickly and I'm just wondering if anyone's tried it?

-- 
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
The OCaml Journal
http://www.ffconsultancy.com/products/ocaml_journal/?e


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

end of thread, other threads:[~2007-07-16 17:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-16  5:30 CallCC using fork (and garbage collected processes) Jon Harrop
2007-07-16  6:07 ` [Caml-list] " skaller
2007-07-16 16:46   ` Richard Jones
2007-07-16 17:25     ` skaller
2007-07-16 17:57       ` Tom

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