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] unix.chop_extension
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-05-27 (07:47)
From: Markus Mottl <markus@o...>
Subject: Re: [Caml-list] unix.chop_extension
On Thu, 27 May 2004, skaller wrote:
> AFAIK: The C Pcre that it wraps does use global variables 
> and so while the interface appears re-entrant
> it isn't.

To prevent people from getting a false impression of PCRE as interfaced
to OCaml: it _is_ safe.  Calling PCRE-functions from threads or executing
two different regular expressions in an intermittent way should never
crash your program or lead to unexpected results.

The use of global variables by the C-library does not necessarily imply
that the program is unsafe.  It all depends on their use, and in this
case the global variables (e.g. pcre_callout) are initialized exactly
once at startup time, i.e. before the user can access any functions.

Libraries implemented in imperative style may still have reentrant

Markus Mottl          http://www.oefai.at/~markus          markus@oefai.at

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