caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Keith Wansbrough <Keith.Wansbrough@cl.cam.ac.uk>
To: skaller@users.sourceforge.net
Cc: Jon Harrop <jdh30@cam.ac.uk>, caml-list <caml-list@inria.fr>
Subject: Re: [Caml-list] Ocamlyacc reentrancy
Date: Wed, 05 May 2004 12:52:06 +0100	[thread overview]
Message-ID: <E1BLKwY-0003zP-00@mta1.cl.cam.ac.uk> (raw)
In-Reply-To: Your message of "01 May 2004 15:36:01 +1000." <1083389761.20722.15.camel@pelican.wigram>

> On Sat, 2004-05-01 at 14:47, Jon Harrop wrote:
> > Apparently the Parser module should be reentrant because it is careful to save 
> > and load its global data.
> > 
> > http://pauillac.inria.fr/caml/caml-list/0258.html
> 
> Thanks for that link.  Xavier says:
> 
> "The module Parsing is supposed to be reentrant. Yes, there's some 
> global state inside, but we're careful to save and restore it across 
> entries. If you have a program demonstrating non-reentrance, please 
> send it to me privately and I'll try to fix that."

What about multithreaded code?

We wrote a couple of scripts that hack the output of ocamllex and
ocamlyacc, and a slightly modified lexing.ml and parsing.ml, that give
you purely functional lexers and parsers.  The modification is trivial
- just pass the state around in an argument, rather than a global
variable.

Let me know if you are interested.  I think we got some positive
noises from INRIA, but I'll leave it to them to comment re future
OCaml releases.  We didn't consider performance impact.

--KW 8-)

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


  parent reply	other threads:[~2004-05-05 11:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-01  3:08 skaller
2004-05-01  4:47 ` Jon Harrop
2004-05-01  5:36   ` skaller
2004-05-02 20:38     ` Eckart Goehler
2004-05-05 11:52     ` Keith Wansbrough [this message]
2004-05-05 14:00       ` skaller

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=E1BLKwY-0003zP-00@mta1.cl.cam.ac.uk \
    --to=keith.wansbrough@cl.cam.ac.uk \
    --cc=caml-list@inria.fr \
    --cc=jdh30@cam.ac.uk \
    --cc=skaller@users.sourceforge.net \
    /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;
as well as URLs for NNTP newsgroup(s).