From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,4cf1fd41f64f8f02 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail NNTP-Posting-Date: Thu, 01 Jun 2006 14:30:53 -0500 From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: task-safe hash table? References: X-Newsreader: Tom's custom newsreader Message-ID: Date: Thu, 01 Jun 2006 14:30:53 -0500 NNTP-Posting-Host: 67.169.16.3 X-Trace: sv3-5oD9xe/Qa1XhGsCYqApWzjhqEbmGGslrIhfue0Pb0jVJg3JL33NaI9rsJfRYOAPHsvTlcUm+8X3FZPa!oPGjcmowI3RkflLL1KJ++LKNDLfU95EF5pUACKIuC1MgopfPqH/kRUwonL9jKYz+inoQdVeu1Wvt!ONLkZhR0GtTy X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.32 Xref: g2news2.google.com comp.lang.ada:4637 Date: 2006-06-01T14:30:53-05:00 List-Id: > > I think you might be able to get part way by consulting the original > > Booch components. > > The 95 BCs were going to have Synchronized and Guarded extensions, but The app I had in mind was the k-nucleotide shootout benchmark, which uses a hash table, running on a multi-core cpu. If lookups are read-only, and are much more frequent than writes, one should be able to do them concurrently. Since a lookup in a hash table is, presumably, pretty fast, the overhead of making it Protected would probably kill the gain. But one ought to be able to arrange things so a concurrent lookup that comes back with a hit is correct, ie most of the time, while one that comes back "we need to add this" would be rare enough that interlocking for a second check and possible add wouldn't cancel the wall clock savings. So this is a very specific test to see what Ada tasking, on a modern chip, buys you on this particular app. (I already know it's a win on the word count and on a sort.) I'm just hearing too many people say "multi-core is dumb because nobody knows how to do concurrent programming".