Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
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
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