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 SAA32239 for caml-red; Mon, 11 Dec 2000 18:33:23 +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 BAA24702 for ; Sun, 10 Dec 2000 01:32:23 +0100 (MET) Received: from miss.wu-wien.ac.at (miss.wu-wien.ac.at [137.208.107.17]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id eBA0WMr12851 for ; Sun, 10 Dec 2000 01:32:22 +0100 (MET) Received: (from mottl@localhost) by miss.wu-wien.ac.at (8.9.0/8.9.0) id BAA20219; Sun, 10 Dec 2000 01:32:06 +0100 (MET) Date: Sun, 10 Dec 2000 01:32:05 +0100 From: Markus Mottl To: Gerd Stolpmann Cc: Miles Egan , OCAML Subject: Re: features of PCRE-OCaml Message-ID: <20001210013205.B8110@miss.wu-wien.ac.at> References: <20001206015139.D31140@miss.wu-wien.ac.at> <00120816434509.00625@ice> <20001209040315.D26367@miss.wu-wien.ac.at> <0012091437390B.00625@ice> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <0012091437390B.00625@ice>; from gerd@gerd-stolpmann.de on Sat, Dec 09, 2000 at 14:12:13 +0100 Sender: weis@pauillac.inria.fr Gerd Stolpmann schrieb am Saturday, den 09. December 2000: > I would say it depends on the problem size. For example, when searching in a > long text it is definitely worth-while to release the masterlock. [snip] > I think it is worth an experiment. I have first given it a thought experiment and came to the conclusion that it does not seem to be a good idea to have a default with possibly superfluous overheads. If somebody really wants to exploit multi-processor machines with OCaml, it is probably best to have additional functions (or even better: a different module) that are tailored for parallel computation. This moves the responsibility to the programmer, who usually knows best whether parallelism for specific uses is worth the overhead. If somebody wants to try this out (placing those fancy master lock functions around various code parts in the C-interface (pcre-OCaml/pcre_intf.c) and measure the performance difference), just fetch the current sources from the CVS-repository on Sourceforge: http://sourceforge.net/cvs/?group_id=15427 It should be very straightforward to add a "parallel" version, but the tuning + experimentation may require some work. Maybe two submodules in the "Pcre"-module would be nice: something like "Pcre.Normal" and "Pcre.Parallel", both of which have the same interface and can even share values so that one could choose at runtime which version should execute a regular expression (or compile one, etc.). I'd be happy to let you integrate a solution for parallel pattern matching. I don't need this feature right now, but I'd be interested in reports on executing regexps of PCRE-OCaml in parallel on a 32 processor machine... ;) - Markus Mottl -- Markus Mottl, mottl@miss.wu-wien.ac.at, http://miss.wu-wien.ac.at/~mottl