[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [c api] Finding coroutine "parent"
- From: Javier Guerra <javier@...>
- Date: Wed, 8 Jul 2009 13:54:16 -0500
On Wed, Jul 8, 2009 at 12:59 PM, Jerome Vuarand<jerome.vuarand@gmail.com> wrote:
> 2009/7/8 <matias.guijarro@free.fr>:
>> I wonder if there is a way to determine the "parent" lua_State
>> of a coroutine, given its own lua_State. In other words, I am
>> trying to find the lua_State a given coroutine has been created
>> from.
>>
>> Is it possible ?
>> For the moment I am stuck.
>
> It is not possible. A coroutine "A" can create a coroutine "B", pass
> it to a coroutine "C", and terminate. "A" was the creator of "B", but
> it no longer exists. There is no coroutine ownership mechanism,
> coroutines are garbage collected objects like tables or functions.
the full creation tree isn't relevant; but knowing that all those
coroutines (or threads, from the C API) belong to the same lua_State
is quite valuable.
--
Javier