bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: mach_task_self, mach_thread_self, mach_host_self


From: Richard Braun
Subject: Re: mach_task_self, mach_thread_self, mach_host_self
Date: Wed, 3 Jun 2015 12:10:16 +0000
User-agent: Mutt/1.5.21 (2010-09-15)

On Wed, Jun 03, 2015 at 01:54:40PM +0200, Justus Winter wrote:
> I independently rediscovered that host port leak.  I see two options
> how to proceed:

The host and task ports actually don't leak, because they're unique to
a task, and Mach treats them as exceptions by never overruning the user
space ref count. This means that calling mach_host_self() a lot of times
results in a single name with a very high ref count, and nothing else.
This is the expected behaviour.

On the other hand, threads die in a task, and not releasing names
obtained with mach_thread_self() is indeed a leak. This was the main
difficulty with thread destruction in libpthread. I don't remember
if there were leaks elsewhere.

-- 
Richard Braun



reply via email to

[Prev in Thread] Current Thread [Next in Thread]