Closed autopear closed 6 months ago
The change is reasonable, but I'm a little concerned with the way fiber's ID is defined.
Although the address of ExitBarrier
is unique for each fiber, it seems unintuitive to use it as fiber's ID as opposed to using the address of FiberEntity
. I guess this had something to do why I didn't add this member function to Fiber
...
If we're going to add such a member function, I think it's better for us to somehow figure out how to associate fiber's ID with its control block, i.e., FiberEntity
.
On a second though, I think the use of ExitBarrier
's address is justified. FiberEntity
is associated with fiber's stack, which is a scarce resource. We can't afford to keep fiber's stack held until all instances of its Fiber
s are gone. Therefore, fiber's stack, as well as FiberEntity
, may well be gone long before all Fiber
s are gone, and using FiberEntity
's address is no longer a viable option.
I'm ok with the overall design now.
The CIs are failing, do you mind taking a look at them?
On a second though, I think the use of
ExitBarrier
's address is justified.FiberEntity
is associated with fiber's stack, which is a scarce resource. We can't afford to keep fiber's stack held until all instances of itsFiber
s are gone. Therefore, fiber's stack, as well asFiberEntity
, may well be gone long before allFiber
s are gone, and usingFiberEntity
's address is no longer a viable option.I'm ok with the overall design now.
The CIs are failing, do you mind taking a look at them?
It's fixed now, but I'm not sure why the bazel build is failing.
Merged, thanks!
I was meant to take a look at Bazel failure but it was deferred due to my time constraints. It's not related to your changes.
Similar to
std::thread
, Fiber should also have aget_id
method.