From: Xavier Leroy <Xavier.Leroy@inria.fr>
Subject: Re: camlex/camlyacc + threads problem
In-Reply-To: <199709100817.KAA05734@yeti.didac-mip.fr> from Olivier Bouyssou at "Sep 10, 97 10:17:24 am"
Date: Thu, 18 Sep 1997 16:18:26 +0200 (MET DST)
> I've a problem when I use a parser in multiple threads. If the calls to the
> parser are not enclosed by a mutex, there are parse errors. ( See example in
> french version )
Of course. Most of the O'Caml standard library is *not* thread-safe
yet. So far, everything in Pervasives is thread-safe, in particular
I/O, but other stateful libraries are not. This includes in
particular Hashtbl, Queue, and Lexing.
There are no easy ways to make a library thread-safe and still have it
working in the non-threaded case. So, I'm not promising these
problems will be fixed soon.
In the meantime, use mutexes liberally, or make sure that only one
thread is doing e.g. parsing.
- Xavier Leroy
This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:12 MET