comp.lang.ada
 help / color / mirror / Atom feed
From: tmoran@acm.org
Subject: Re: task-safe hash table?
Date: Sat, 03 Jun 2006 01:50:49 -0500
Date: 2006-06-03T01:50:49-05:00	[thread overview]
Message-ID: <u5CdnZhDM4LUrBzZnZ2dnUVZ_vGdnZ2d@comcast.com> (raw)
In-Reply-To: edjojeeb1lwl$.gqavpe4tqkfp.dlg@40tude.net

>Functions on protected objects could potentially run in parallel on a
>multi-core CPU. Does anybody know if GNAT does this?
>...
>What about a window in which each task makes, say, n searches. n is the
>window size. All misses are postponed till the window end. At that point
  I tried a simple approach:  Lookup is asynchronous, Insert is Protected.
I ran the test data using Gnat 3.15p on a dual-core Pentium and looking at
the Task Manager CPU usage.  With a small number of large buckets in the
hash - so a lookup scans a rather long list and takes a long time - CPU
usage is around 75% (of the total two CPUs).  So there's overlap.  With a
more reasonable hash with a large number of small buckets, the Protected
overhead is larger relative to the "useful work", and CPU usage goes down
to more like 40% (I presume the missing 10% is probably tallied as System
time in task switching instead of app time).  Since by far the best speed
comes from a large number of small buckets, this approach to doing the job
concurrently is a losing proposition.
  Perhaps a windowing or batching approach such as you suggest would
distribute the Protected overhead over more useful work and make the
concurrent approach faster.  I'll look into that this weekend.



  parent reply	other threads:[~2006-06-03  6:50 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-29 21:42 task-safe hash table? tmoran
2006-05-29 22:56 ` John
2006-05-30  0:18   ` tmoran
2006-05-30  3:50     ` John
2006-05-30  4:35       ` tmoran
2006-05-30  9:50         ` Georg Bauhaus
2006-06-01  6:32   ` Simon Wright
2006-06-01 19:30     ` tmoran
2006-06-01 20:03       ` Ludovic Brenta
2006-06-01 20:07       ` Dmitry A. Kazakov
2006-06-02  4:31         ` Jeffrey R. Carter
2006-06-02 10:36         ` Stephen Leake
2006-06-03  6:50         ` tmoran [this message]
2006-06-03 20:40           ` tmoran
2006-06-02 10:35       ` Stephen Leake
2006-06-02 20:19         ` tmoran
2006-06-03 21:10           ` M E Leypold
2006-06-04  0:23             ` tmoran
2006-06-04 12:55           ` Stephen Leake
2006-06-04 17:22             ` tmoran
2006-06-08  1:10               ` Stephen Leake
2006-06-11 13:29               ` Georg Bauhaus
2006-06-04 17:48             ` Simon Wright
2006-06-05  0:23               ` tmoran
2006-06-05 21:57           ` Steve Whalen
2006-06-06 11:10             ` Ole-Hjalmar Kristensen
2006-05-30 15:00 ` Matthew Heaney
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox