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 Newsgroups: comp.lang.ada Subject: Re: task-safe hash table? References: From: M E Leypold Date: 03 Jun 2006 23:10:21 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii User-Agent: Some cool user agent (SCUG) NNTP-Posting-Host: 88.72.202.67 X-Trace: news.arcor-ip.de 1149368710 88.72.202.67 (3 Jun 2006 23:05:10 +0200) X-Complaints-To: abuse@arcor-ip.de Path: g2news2.google.com!news4.google.com!news.glorb.com!feed.xsnews.nl!feeder.xsnews.nl!news.germany.com!news.unit0.net!newsfeed.arcor-ip.de!news.arcor-ip.de!not-for-mail Xref: g2news2.google.com comp.lang.ada:4669 Date: 2006-06-03T23:10:21+02:00 List-Id: tmoran@acm.org writes: > > > the overhead of making it Protected would probably kill the gain. > > > > What "overhead"? > In a trivial single-tasking test program on my machine, a call to a > Protected function compiled with Gnat 3.15p -O2 takes > 0.304697000 mics while a call to a regular function takes > 0.022779000 microseconds. > Using -O3, it's > 0.291347000 mics while a call to a regular function takes > 0.001893000 microseconds. Which OS is that? I've just stumbled upon the commentary in the 3.15p install instructions, that at linux, 3.15p uses FSU-threads and at (i.e) Solaris it would use native threads. Would that perhaps make a difference (I wonder wether any 'rescheduling' of threads is taking place -- perhaps only implicitly -- in the lower level abstraction layer when GNAT is handling the entry into the protected object?) I'm admittedly only wildly speculating, but I'd like to anchor you empirical data to some solid coordinates like "at system X gnat 3.15p takes 15 times longer to enter a protected function than a "normal" function". If then a second data point comes along we/I'll have something to think about :-). Regards -- Markus