Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
From: Markus Mottl <mottl@m...>
Subject: Re: features of PCRE-OCaml
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