From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id RAA31025 for caml-red; Mon, 11 Dec 2000 17:56:53 +0100 (MET) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id OAA06599 for ; Fri, 8 Dec 2000 14:11:58 +0100 (MET) Received: from moutvdom01.kundenserver.de (moutvdom01.kundenserver.de [195.20.224.200]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id eB8DBv522838 for ; Fri, 8 Dec 2000 14:11:57 +0100 (MET) Received: from [195.20.224.220] (helo=mrvdom04.kundenserver.de) by moutvdom01.kundenserver.de with esmtp (Exim 2.12 #2) id 144NJY-0000Lh-00; Fri, 8 Dec 2000 14:11:52 +0100 Received: from drms-3e364b69.pool.mediaways.net ([62.54.75.105] helo=ice.gerd-stolpmann.de) by mrvdom04.kundenserver.de with esmtp (Exim 2.12 #2) id 144NJU-0000id-00; Fri, 8 Dec 2000 14:11:48 +0100 Received: from localhost (localhost [[UNIX: localhost]]) by ice.gerd-stolpmann.de (8.9.3/8.9.3) id NAA17865; Fri, 8 Dec 2000 13:57:16 +0100 From: Gerd Stolpmann Reply-To: gerd@gerd-stolpmann.de Organization: privat To: Miles Egan , Markus Mottl Subject: Re: features of PCRE-OCaml Date: Fri, 8 Dec 2000 13:30:55 +0100 X-Mailer: KMail [version 1.0.28] Content-Type: text/plain Cc: OCAML References: <20001206015139.D31140@miss.wu-wien.ac.at> <20001207121757.A59914@caddr.com> In-Reply-To: <20001207121757.A59914@caddr.com> MIME-Version: 1.0 Message-Id: <00120813571607.00625@ice> Content-Transfer-Encoding: 8bit Sender: weis@pauillac.inria.fr 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 -- ---------------------------------------------------------------------------- Gerd Stolpmann Telefon: +49 6151 997705 (privat) Viktoriastr. 100 64293 Darmstadt EMail: gerd@gerd-stolpmann.de Germany ----------------------------------------------------------------------------