<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"><channel><title>mikeash.com pyblog/friday-qa-2017-09-22-swift-4-weak-references.html comments</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2017-09-22-swift-4-weak-references.html#comments</link><description>mikeash.com Recent Comments</description><lastBuildDate>Tue, 12 May 2026 01:39:12 GMT</lastBuildDate><generator>PyRSS2Gen-1.0.0</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>mikeash - 2017-10-28 15:06:39</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2017-09-22-swift-4-weak-references.html#comments</link><description>&lt;b&gt;Michael M. Mayer&lt;/b&gt;: Thanks for the reminder. I'll see if I can do that topic soon.</description><guid isPermaLink="true">7e9e5c0c756d4d227a4c45341426308c</guid><pubDate>Sat, 28 Oct 2017 15:06:39 GMT</pubDate></item><item><title>Michael M. Mayer - 2017-10-21 19:51:44</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2017-09-22-swift-4-weak-references.html#comments</link><description>You mentioned on &lt;i&gt;Swift Unwrapped&lt;/i&gt; that you were considering doing unowned references as a follow up to this article (which was your usual wonderful).  That would be great if you could explain unowned references under Swift 4. Thanks!</description><guid isPermaLink="true">68851fbe403996e1f7f658c9e42b3243</guid><pubDate>Sat, 21 Oct 2017 19:51:44 GMT</pubDate></item><item><title>Evan Olcott - 2017-09-24 09:54:16</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2017-09-22-swift-4-weak-references.html#comments</link><description>Well then, that begs the question (sorta): is the an equivalent locking, dynamic, “function cache”?</description><guid isPermaLink="true">7a0d259ad4c87934a6142039b0731641</guid><pubDate>Sun, 24 Sep 2017 09:54:16 GMT</pubDate></item><item><title>mikeash - 2017-09-23 23:40:43</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2017-09-22-swift-4-weak-references.html#comments</link><description>&lt;b&gt;K:&lt;/b&gt; Mostly from reading the source (including the excellent comments within) and some runtime inspection. There are things where looking at the bits and bytes is easier than decoding the C++. My memorydumper2 (&lt;a href="https://github.com/mikeash/memorydumper2"&gt;https://github.com/mikeash/memorydumper2&lt;/a&gt;) project helped a lot, although it had some trouble due to the low bits used as flags. I have no idea where one might find design info besides the mailing lists.
&lt;br /&gt;
&lt;br /&gt;&lt;b&gt;Evan Olcott&lt;/b&gt; and &lt;b&gt;Jean-Daniel:&lt;/b&gt; There are several ways for ObjC to go wrong in a real-time thread. Memory allocation is one, as mentioned. Another is the potentially unbounded search time for the target method if the method cache doesn't contain it (which can happen at any time due to other code clearing the cache). In rare cases you can end up trying to acquire locks, such as when you're sending the first message to a class (which could be a dynamically allocated subclass like the ones used with KVO).</description><guid isPermaLink="true">48909fcd0bfaf2ac108d90945f9b557a</guid><pubDate>Sat, 23 Sep 2017 23:40:43 GMT</pubDate></item><item><title>Jean-Daniel - 2017-09-23 21:36:01</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2017-09-22-swift-4-weak-references.html#comments</link><description>@Evan Olcott: I think that the main issue with Obj-C in real time thread is not the retain count side table, it is the method cache. Any call can require it to grow and doing so require an calloc call that is not safe on real-time thread.
&lt;br /&gt;
&lt;br /&gt;</description><guid isPermaLink="true">7ba3e819ff3afea6e520bd30b42edff7</guid><pubDate>Sat, 23 Sep 2017 21:36:01 GMT</pubDate></item><item><title>Evan Olcott - 2017-09-23 20:20:33</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2017-09-22-swift-4-weak-references.html#comments</link><description>This is the first time I’ve seen an honest explanation about why it’s said to “not use objective c for real-time threads because any objective c call can lock”. It’s reading from a shared table and hS to protect access.
&lt;br /&gt;
&lt;br /&gt;So, that said, it appears as though native Swift does not have this problem? Is that true?  Does Swift use any locking in object access? If not, that could open up a whole new world for real-time threads...</description><guid isPermaLink="true">8d6fe749bdbc6fee2cf3221112b579d6</guid><pubDate>Sat, 23 Sep 2017 20:20:33 GMT</pubDate></item><item><title>K - 2017-09-23 19:00:07</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2017-09-22-swift-4-weak-references.html#comments</link><description>This is a nice, clear description of weakrefs in Swift.
&lt;br /&gt;
&lt;br /&gt;Did you get this entirely from reading the source?  If so, that's impressive.  (Where do you find hours in the day?)
&lt;br /&gt;
&lt;br /&gt;I assume that the folks on the Swift core team use whiteboards or something.  Is there any way us mortals can get access to any higher-level design specifics?  Swift-evo is neat but that seems to be more documentation after-the-fact.
&lt;br /&gt;
&lt;br /&gt;Or do they actually hash all this out by emails that say "We should do X", "No, that doesn't take into account issue Y", "OK, so Z it is.  I'll write the code now", etc?
&lt;br /&gt;
&lt;br /&gt;I've written compilers before and I don't know how you can write a compiler without a few square miles of whiteboards.</description><guid isPermaLink="true">3de13a566eb4c029c417781f4b08062e</guid><pubDate>Sat, 23 Sep 2017 19:00:07 GMT</pubDate></item></channel></rss>
