Re: Parallel Text Corpus Processing with Ada?

"Simon Wright" <simon.j.wright@xxxxxxx> wrote in message
braver <deliverable@xxxxxxxxx> writes:

On Nov 14, 1:45 am, Simon Wright <simon.j.wri...@xxxxxxx> wrote:
You did spot that Ada.Containers aren't task-safe? (ie, you need to
lock the containers yourself ...)

Man, that's a problem! What about BCs, are they task-safe?

At one point the BCs followed their original C++ source by providing a
couple of synchronised forms.

I found that for any serious use I couldn't find a one-size-fits-all
(well, few-sizes-fit-all perhaps) approach that let me build real
apps. Iterators were one problem, applications where the data
structure involves multiple containers was another. I did consider
some shared-mutex schemes (would have involved something like
constraining container instances by access Mutex'Class or some
such). But on the whole it seemed that it would be better to require
people to but the protection _they_ need round their data.

Which is the same reason that the standard Ada containers don't allow
multiple tasks accessing a single container. (Nor does any other Ada
predefined library, for that matter. This is the standard behavior of Ada
predefined libraries - see RM A(3) - that's paragraph 3 at the beginning of
Annex A - there is nothing specific to containers here.)

There is some work going on to provide some for of "protected" containers,
but it is not clear what or when that will come to fruition.