Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Xavier Leroy <xavier.leroy@inria.fr>
To: Dmitry Bely <dbely@mail.ru>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] ocamldebug and windows
Date: Tue, 22 Oct 2002 09:57:40 +0200	[thread overview]
Message-ID: <20021022095740.A6289@pauillac.inria.fr> (raw)
In-Reply-To: <r8ejkhao.fsf@mail.ru>; from dbely@mail.ru on Mon, Oct 21, 2002 at 06:17:19PM +0400

> > You need a bit more than this: file and socket handles also need some
> > checkpointing (of the kind that fork() does on file descriptors in the
> > Unix world).
> 
> Really? Correct me if I am wrong, but fork() should care of the proper
> handle copying because it creates the new child process, that should be in
> the same state. But I suggest to use the only process, just save/restore
> its state somethere when needed. This way the memory dump seems to be
> sufficient, no?

I'm afraid not.  Consider the following program:

    time t1:  open file /tmp/foo, obtaining file handle #3 (for instance)
    time t2:  work on this file handle
    time t3:  close file handle
    time t4:

Assume we're at time t4, and want to go back to the checkpoint at time
t2.  With the solution you outline, file handle #3 is closed and
re-executing the code between t2 and t3 fails.

It is true that time-travel in the presence of I/O is, in general,
impossible.  (You can't "un-send" the network packets that were
already sent!)  However, I'd like it to work at least for programs
that read or write regular files, as in the example above.  Under
Unix, fork() gets us 90% there -- there is still an issue with the
reading/writing position being shared (not duplicated) between the
parent and child process, but we are considering hacks to work around
this.  

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


  reply	other threads:[~2002-10-22  7:57 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-21 10:43 Dmitry Bely
2002-10-21 13:21 ` Xavier Leroy
2002-10-21 14:17   ` Dmitry Bely
2002-10-22  7:57     ` Xavier Leroy [this message]
2002-10-22 11:23       ` Nicolas Cannasse
2002-10-22 15:56       ` Chris Hecker
2002-10-22 16:42         ` Mattias Waldau
2002-10-22 20:46           ` Pierre Weis
2002-10-23  6:58         ` Alessandro Baretta

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=20021022095740.A6289@pauillac.inria.fr \
    --to=xavier.leroy@inria.fr \
    --cc=caml-list@inria.fr \
    --cc=dbely@mail.ru \
    /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