English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
[Caml-list] Ocamlyacc reentrancy
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-05-05 (11:52)
From: Keith Wansbrough <Keith.Wansbrough@c...>
Subject: Re: [Caml-list] Ocamlyacc reentrancy
> 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

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