You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Do you have any suggestions on getting cqueues to work seamlessly with Tarantool fibers?
I've interposed step like this, which lets me call :step and :loop within a fiber.
Now I'm trying to get cq.poll() to not cause a "yield across C-call boundary" error when called within a fiber.
I think the issue is that cq.running() doesn't return nil when within a fiber, which make sense. Unfortunately, that behavior makes this line and this line problematic. If those two lines did select(2, cq.running()), it would ensure the current coroutine is a cqueue before doing a native poll.
I may need to handle this by monkey-patching fiber.create, but I'm curious if a simpler solution exists with cqueues. In the end, it may be easiest (but less convenient) to avoid fibers within cqueues at all costs. Thanks!
The text was updated successfully, but these errors were encountered:
Another issue: yielding the parent fiber from within a cqueue is nasty business. The cqueue will still think it's running, when in reality its parent fiber is suspended. This makes the return value of core.running incorrect.
On second thought, I think exposing Tarantool's scheduler so it can be driven with a cqueue could be a viable option. But maybe not, since coroutine.yield is used by cqueues, which Tarantool's scheduler may not like.
Do you have any suggestions on getting cqueues to work seamlessly with Tarantool fibers?
I've interposed
step
like this, which lets me call:step
and:loop
within a fiber.Now I'm trying to get
cq.poll()
to not cause a "yield across C-call boundary" error when called within a fiber.I think the issue is that
cq.running()
doesn't return nil when within a fiber, which make sense. Unfortunately, that behavior makes this line and this line problematic. If those two lines didselect(2, cq.running())
, it would ensure the current coroutine is a cqueue before doing a native poll.I may need to handle this by monkey-patching
fiber.create
, but I'm curious if a simpler solution exists with cqueues. In the end, it may be easiest (but less convenient) to avoid fibers within cqueues at all costs. Thanks!The text was updated successfully, but these errors were encountered: