Quoting Justus Winter (2015-04-03 11:55:07) > Quoting Samuel Thibault (2014-12-09 02:21:20) > > Justus Winter, le Thu 04 Dec 2014 15:39:04 +0100, a écrit : > > > If we now `ports_destroy_right' X, and at the same time the last send > > > right to X is destroyed, there's a chance that said notification is > > > already delivered to X. > > > > Mmm, isn't that also true for any kind of message? > > You are right, it is. > > I briefly spoke with Richard about the problem. He suggested to > insert a tomb-stone in ports_destroy, and use Mach's no-senders > notification to deallocate the portinfo structure. No need for a > fancy deallocation scheme.
Having spent more time on this, forget what I wrote yesterday. In fact, I came up with a reasonable simple solution to the problem. It involves keeping track of threads servicing a port bucket, and deferring the deallocation of problematic port_info objects until every currently executing thread has gone through a quiescent state. See the changes to manage-multithread.c and port-deref-deferred.c of the following patch. Justus