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
features of PCRE-OCaml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2000-12-11 (16:56)
From: Gerd Stolpmann <gerd@g...>
Subject: Re: features of PCRE-OCaml
On Thu, 07 Dec 2000, Miles Egan wrote:
>On Wed, Dec 06, 2000 at 01:51:39AM +0100, Markus Mottl wrote:
>> Hello,
>> it seems that many people hadn't yet learnt about PCRE-OCaml (the
>> OCaml-interface to the PCRE-library) and have asked for more information
>> on the advantages as compared to the Str-library (or to Perl).
>It would be wonderful if this became part of the standard distribution.  This is
>a very handy library but I sometimes avoid it because I don't want to deal with
>installing it everywhere I want to run my app.

I would appreciate this, too. PCRE regexps have often a simpler notation
because they need fewer backslashes. Furthermore, the reentrant interface of
PCRE has advantages in multi-threaded programs (with Str, you have to throw
with mutexes after the regexps...)

However, the PCRE stubs can be improved in one point: The master lock could be
released while the engine executes the regexp. Several threads could then
use the engine at the same time which would improve the responsiveness of
multi-threaded programs, and the programs would run faster on SMP systems.
(Currently, the so-called "master lock" prevents that more than one thread runs
at the same time (to avoid problems with uninitialized memory). However, when
O'Caml calls a C function which is thread-safe itself, one can release this
lock for the time of the call, because C can cope with uninitialized memory.)
As regexp matching takes some time, there could be an interesting speedup for
programs that massively apply regexps.

Gerd Stolpmann      Telefon: +49 6151 997705 (privat)
Viktoriastr. 100             
64293 Darmstadt     EMail:   gerd@gerd-stolpmann.de