[m-rev.] for review: threadsafe version_arrays in Java

Julien Fischer juliensf at csse.unimelb.edu.au
Fri Apr 16 18:59:49 AEST 2010


On Fri, 16 Apr 2010, Peter Wang wrote:

> On 14 April 2010 16:22, Peter Ross <pro at missioncriticalit.com> wrote:
>> Hi,
>>
>> Peter Wang is probably the best person to review this.
>>
>> Ralph might want to make version_arrays thread safe on the C backend,
>> however at least now the user will get an error when they try and use
>> the non-safe version_array in a context where it might have to support
>> concurrent access.
>
> I have made the analogous change for the C backends.
> Committed this.
>
>
> Estimated hours taken: 12 + some
> Branches: main, 10.04
>
> Make the version_array and version_hash_table types thread safe in the C and
> Java grades.
>
> Supply unsafe initialization functions so that users use non-thread safe types
> with the proviso that they don't concurrently access the array or hash table.
>
> The synchronized version dramatically slows down version_array.lookup (100x
> slower on Java).
>
> However the test case MC uses which is to replace a map being used as
> a memo table
> with a version_hash_table for the memo_table it is still approximately
> 40% faster
> than the map even with the synchronization overhead.
>
> The Java side of this patch was by Peter Ross.

You should announce the fact that there are thread-safe and
non thread-safe versions of version arrays in the NEWS file.

Julien.
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list