Bug #15041
closed
[PATCH] cont.c: set th->root_fiber to current fiber at fork
Added by normalperson (Eric Wong) about 6 years ago.
Updated almost 6 years ago.
Description
cont.c: set th->root_fiber to current fiber at fork
Otherwise, th->root_fiber can point to an invalid Fiber,
because Fibers do not live across fork. So consider
whatever Fiber is running the root fiber.
Files
(I'm not sure why fork removes other fibers, but)
I think it is okay. let's try.
- Status changed from Open to Closed
Applied in changeset trunk|r64589.
cont.c: set th->root_fiber to current fiber at fork
Otherwise, th->root_fiber can point to an invalid Fiber,
because Fibers do not live across fork. So consider
whatever Fiber is running the root fiber.
[ruby-core:88723] [Bug #15041]
ko1@atdot.net wrote:
(I'm not sure why fork removes other fibers, but)
fib = Fiber.new { puts " HI" }
fork { fib.resume }
Process.waitall
Shows me: `resume': fiber called across stack rewinding barrier (FiberError)
If we reimplement Fiber entirely with Ruby bytecode, then we
can we can jump around anywhere (and migrate fibers across
threads). But we lose C extension compatibility.
I think it is okay. let's try.
OK, r64589
On 2018/08/29 17:09, Eric Wong wrote:
Shows me: `resume': fiber called across stack rewinding barrier (FiberError)
Yes, I tried similar code.
Not sure why...
Nobu?
--
// SASADA Koichi at atdot dot net
- Backport changed from 2.3: REQUIRED, 2.4: REQUIRED, 2.5: REQUIRED to 2.3: REQUIRED, 2.4: REQUIRED, 2.5: DONE
ruby_2_5 r66818 merged revision(s) 64589,64593.
- Backport changed from 2.3: REQUIRED, 2.4: REQUIRED, 2.5: DONE to 2.3: REQUIRED, 2.4: DONE, 2.5: DONE
ruby_2_4 r66968 merged revision(s) 64589,64593.
- Backport changed from 2.3: REQUIRED, 2.4: DONE, 2.5: DONE to 2.3: REQUIRED, 2.4: REQUIRED, 2.5: DONE
Also available in: Atom
PDF
Like0
Like0Like0Like0Like0Like0Like0Like0