[Cbe-oss-dev] Lifetime of SPE contexts & gangs

Arnd Bergmann arnd at arndb.de
Thu May 10 03:02:14 EST 2007


On Wednesday 09 May 2007, Jeremy Kerr wrote:
> * Each context within a gang holds a reference to the gang via the 
> gang's refcount, and closing the gang fd decreases it. So, if you close 
> the gang fd, the gang dir only gets removed when the last context is 
> destroyed.
> 
> * Closing a gang causes the gang's contexts to be destroyed at the same 
> time, regardless of whether the process holds an open file descriptor 
> to any of the contexts.
> 
> * Destroying the gang causes its contexts to be reparented to the root 
> of the spu filesystem. Libspe might get a little confused by this 
> though..
> 
> I think the first may be the correct way to go, but it may be a little 
> strange for users to see contexts that they have 'destroyed'. Anyone 
> have particular opinions on this?

Yes, doing it the first way was my intention when I implemented the
gang code initially. I think it's simply a bug that it doesn't work
this way right now.

This is consistent with how the reference counting works if you have
for instance you current working directory in sysfs while a device
goes away -- the directory stays alive until the user gives up
the last reference to it.

	Arnd <><



More information about the cbe-oss-dev mailing list