[parrot/parrot] d14c5e: [pmc] Clarify dead coroutines

GitHub noreply at github.com
Thu Oct 16 09:14:20 UTC 2014


  Branch: refs/heads/rurban/coros-gh564
  Home:   https://github.com/parrot/parrot
  Commit: d14c5ed3cc13e5921869c0baee849476a81bd881
      https://github.com/parrot/parrot/commit/d14c5ed3cc13e5921869c0baee849476a81bd881
  Author: Reini Urban <rurban at cpanel.net>
  Date:   2014-10-16 (Thu, 16 Oct 2014)

  Changed paths:
    M docs/book/pir/ch06_subroutines.pod
    M docs/pmc/subs.pod
    M src/pmc/coroutine.pmc
    M t/pmc/coroutine.t

  Log Message:
  -----------
  [pmc] Clarify dead coroutines

Coros are not resumable when all yield states are exhausted.
This is consistent with the LUA design, which we follow, and all other
coro implementations I know of. Just the parrot book argues that after a
return the state should be automatically reset. Technically no problem, even
without the quirks described in https://github.com/parrot/parrot/issues/564#issuecomment-3503597
or via a seperate reset() method, but semantically an auto-reset is problematic.

Added testcases for all the relevant tickets: #564, #585 and there is on
bug remaining: TT #1003 leading to Null PMC access in get_string on a dead coro


  Commit: 86457d1a7d451138d8ca010c1b0f3510bbd40282
      https://github.com/parrot/parrot/commit/86457d1a7d451138d8ca010c1b0f3510bbd40282
  Author: Reini Urban <rurban at cpanel.net>
  Date:   2014-10-16 (Thu, 16 Oct 2014)

  Changed paths:
    M config/gen/makefiles/root.in
    M src/ops/core.ops
    M src/ops/core_ops.c
    M src/pmc/coroutine.pmc
    M src/sub.c

  Log Message:
  -----------
  [pmc] Coroutine is now auto-resetting


  Commit: 5011c55de74a0b26537f2f0b06cb0a1d9c2ffcb7
      https://github.com/parrot/parrot/commit/5011c55de74a0b26537f2f0b06cb0a1d9c2ffcb7
  Author: Reini Urban <rurban at cpanel.net>
  Date:   2014-10-16 (Thu, 16 Oct 2014)

  Changed paths:
    M docs/pmc/subs.pod
    M src/pmc/coroutine.pmc
    M t/pmc/coroutine.t

  Log Message:
  -----------
  [pmc] Add Coroutine.reset() method

Mentioned in GH #564.

It is however more efficient to clone an initial coro and
copy this saved clone back, as the context does not need to
be recreated afresh.


Compare: https://github.com/parrot/parrot/compare/57247d60fe05...5011c55de74a


More information about the parrot-commits mailing list