<p dir="ltr">Well, don't I feel the fool. Thanks. :-)</p>
<p dir="ltr">-Kyle</p>
<div class="gmail_quote">On 2013-09-15 1:18 PM, "Tim Peters" <<a href="mailto:tim.peters@gmail.com">tim.peters@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
[ Kyle Fisher]<br>
> ...<br>
> Even if the iterator freelist isn't in first-level cache, I'm almost certain<br>
> it would exist within last-level cache.  Do you know what the cost of<br>
> fetching from this is compared to grabbing a lock like the current<br>
> _Py_Malloc does?<br>
<br>
It's infinitely more expensive than grabbing a lock ;-)  As Antoine<br>
noted earlier in this thread, while obmalloc.c is sprinkled with<br>
LOCK() and UNLOCK() macros, they all expand  to "nothing" - obmalloc.c<br>
doesn't actually grab any locks (it relies on the GIL to serialize<br>
threads).<br>
<br>
For example, LOCK is defined thusly:<br>
<br>
#define LOCK()          SIMPLELOCK_LOCK(_malloc_lock)<br>
<br>
and above that there's:<br>
<br>
#define SIMPLELOCK_LOCK(lock)   /* acquire released lock */<br>
<br>
Just FYI ;-)<br>
</blockquote></div>