<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:12pt"><div><span>The cache lookup is not exactly for capacity. The cache stores the block info (block flags, block start, and block size) for the memory block. This is the data that is looked up from the GC while holding the global lock.<br></span></div><div><br><span></span></div><div><span>Specifically, in this case, the cache is NOT to blame. The block info is not changing, so looking it up via cache or directly from the GC is not going to make a difference.</span></div><div><br><span></span></div><div><span>However, appending to non-shared arrays in multiple threads is not supported. I'm not sure how it could be done, because the cache relies so much on the fact that the type tells you it's thread local. Any ideas? It would be nice to solve this, because this includes appending to __gshared
arrays.<br></span></div><div><br><span></span></div><div><span>BTW, you can turn off the caching by returning null from __getBlkInfo in rt/lifetime.d, and commenting out the body of __insertBlkInfoCache. This can at least help you narrow down whether it's a cache problem or not. I probably should make a version for testing this.<br></span></div><div><br><span></span></div><div><span>-Steve<br></span></div><div><br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt;"><div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"><font face="Arial" size="2"><hr size="1"><b><span style="font-weight:bold;">From:</span></b> Robert Jacques <sandford@jhu.edu><br><b><span style="font-weight: bold;">To:</span></b> Discuss the phobos library for D <phobos@puremagic.com><br><b><span
style="font-weight: bold;">Sent:</span></b> Saturday, May 7, 2011 2:01 PM<br><b><span style="font-weight: bold;">Subject:</span></b> Re: [phobos] [D-Programming-Language/phobos] 99336f: Fix bug in std.parallelism unittest. (All code ch...<br></font><br>
On Sat, 07 May 2011 07:39:52 -0400, <<a ymailto="mailto:noreply@github.com" href="mailto:noreply@github.com">noreply@github.com</a>> wrote:<br><br>> Branch: refs/heads/master<br>> Home: <a href="https://github.com/D-Programming-Language/phobos" target="_blank">https://github.com/D-Programming-Language/phobos</a><br>> <br>> Commit: 99336f35cd98a56893f5517c1ba2a414abfc7fc1<br>> <a href="https://github.com/D-Programming-Language/phobos/commit/99336f35cd98a56893f5517c1ba2a414abfc7fc1" target="_blank">https://github.com/D-Programming-Language/phobos/commit/99336f35cd98a56893f5517c1ba2a414abfc7fc1</a><br>> Author: dsimcha <<a ymailto="mailto:dsimcha@gmail.com" href="mailto:dsimcha@gmail.com">dsimcha@gmail.com</a>><br>> Date: 2011-05-07 (Sat, 07 May 2011)<br>> <br>> Changed paths:<br>> M std/parallelism.d<br>> <br>> Log Message:<br>> -----------<br>> Fix bug in
std.parallelism unittest. (All code changes are in unit tests, not "real" code.) Basically, appending to arrays with ~= is not thread safe even with manual synchronization.<br><br>Do you know/remember the cause of this? (i.e. are we still using a local look-up cache for capacity?)<br>_______________________________________________<br>phobos mailing list<br><a ymailto="mailto:phobos@puremagic.com" href="mailto:phobos@puremagic.com">phobos@puremagic.com</a><br>http://lists.puremagic.com/mailman/listinfo/phobos<br><br><br></div></div></blockquote></div></div></body></html>