From: Kuba Ober <kuba@mareimbrium.org>
To: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Re: Road to native windows OCaml...
Date: Wed, 15 Oct 2008 09:50:49 -0400 [thread overview]
Message-ID: <200810150950.51153.kuba@mareimbrium.org> (raw)
In-Reply-To: <90823c940810142252q16764d3avcfa9a358d14a719a@mail.gmail.com>
> > Why do we need fork? I need to look at the code...
>
> http://caml.inria.fr/pub/ml-archives/caml-list/1999/03/f44178e212e78826bcbd
>ee52ddf6fd91.en.html
>
> Concerning bytecode debugging under Windows, the major issue is the
> way our debugger performs periodic checkpointing of the running program
> (in order to implement reverse execution). We just use the Unix fork()
> system call, which does everything we want (checkpointing of memory
> and file descriptors, using lazy copy-on-write to minimize copying).
Ah-ha, hmm, I guess I will just have to hack on some "state-preserving"
machinery for win32 world, then. That's way into the future, but should
be doable. Some things cannot be trivially preserved unless you instrument
(wrap) the relevant APIs. Example: on Unices, you can read from a network
stream, fork, and continue on reading in the child process. The parent
process can stop reading and resume at a later point: the kernel will buffer
the data as long as it can (till it runs out of memory). On Windows, this
is not doable without wrapping the relevant Winsock calls, and potentially
all other streaming interfaces that the OCaml application uses either
directly or indirectly.
The checkpointing for OCaml's debugging can perform much better than Cygwin's
fork because the bytecode interpreter controls the application startup and
can put everything (including itself) into memory pages that can be made
copy-on-write at checkpoints. The only benefit to creating separate processes
for each checkpoint is to have more virtual memory available, and to prevent a
crash from doing too much damage. Even then, enough functionality should be
easy to implement to make this feature "do what you expect it to" on Windows.
It's still some work to get it to work, but what the heck: may as well prove
to myself it's doable. That'd come after Camelia is in shape, though.
Cheers, Kuba
next prev parent reply other threads:[~2008-10-15 13:50 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-13 23:35 Kuba Ober
2008-10-13 23:47 ` [Caml-list] " Seo Sanghyeon
2008-10-14 21:32 ` Kuba Ober
2008-10-15 9:42 ` David Allsopp
2008-10-15 12:38 ` Kuba Ober
2008-10-15 13:04 ` Seo Sanghyeon
2008-10-15 14:32 ` Kuba Ober
2008-10-14 5:43 ` Elliott Oti
2008-10-14 21:35 ` Kuba Ober
2008-10-14 7:20 ` Sylvain Le Gall
2008-10-14 21:37 ` [Caml-list] " Kuba Ober
2008-10-15 5:52 ` Dmitry Bely
2008-10-15 13:50 ` Kuba Ober [this message]
2008-10-14 7:59 ` [Caml-list] " David Allsopp
2008-10-14 8:11 ` Daniel Bünzli
2008-10-14 9:19 ` Sylvain Le Gall
2008-10-14 9:41 ` Re : [Caml-list] " Adrien
2008-10-14 10:13 ` Re : " Sylvain Le Gall
2008-10-14 11:07 ` Re : [Caml-list] " Adrien
2008-10-14 11:23 ` Re : " Sylvain Le Gall
2008-10-14 19:39 ` Re : [Caml-list] " Adrien
2008-10-14 21:41 ` Re : [Caml-list] " Kuba Ober
2008-10-15 9:42 ` David Allsopp
2008-10-15 12:33 ` Kuba Ober
2008-10-14 21:39 ` Kuba Ober
2008-10-14 15:56 ` [Caml-list] " David Allsopp
2008-10-14 17:39 ` Re : " Dmitry Bely
2008-10-14 19:31 ` Re : " Adrien
2008-10-14 9:57 ` Mathias Kende
2008-10-14 21:38 ` Kuba Ober
2008-10-15 0:01 ` Sylvain Le Gall
2008-10-15 12:35 ` [Caml-list] " Kuba Ober
2008-10-15 12:54 ` Dmitry Bely
2008-10-15 13:18 ` Sylvain Le Gall
2008-10-15 14:35 ` [Caml-list] " Kuba Ober
2008-10-15 15:29 ` Dmitry Bely
2008-10-15 16:26 ` Kuba Ober
2008-10-15 16:39 ` Xavier Leroy
2008-10-15 5:57 ` [Caml-list] " Dmitry Bely
2008-10-15 9:42 ` David Allsopp
2008-10-26 22:07 ` Markus E L
2008-10-14 9:25 ` Sylvain Le Gall
2008-10-14 18:19 ` Cross-compilation (was: Re: [Caml-list] Road to native windows OCaml...) Richard Jones
2008-10-15 0:04 ` Erik de Castro Lopo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200810150950.51153.kuba@mareimbrium.org \
--to=kuba@mareimbrium.org \
--cc=caml-list@yquem.inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox