aboutsummaryrefslogtreecommitdiffstats
path: root/cont.c
diff options
context:
space:
mode:
authorzverok <zverok.offline@gmail.com>2020-12-23 08:14:18 +0200
committerKoichi Sasada <ko1@atdot.net>2020-12-24 14:37:09 +0900
commit24ae0e8ed73947e030b31badb9d620ddf71898b6 (patch)
tree74fd42d0030395dba991c7a5a3b1cb61de9717b4 /cont.c
parent5696c693540a06c01bf6172d33aff731ad61f871 (diff)
downloadruby-24ae0e8ed73947e030b31badb9d620ddf71898b6.tar.gz
Review comments
Diffstat (limited to 'cont.c')
-rw-r--r--cont.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/cont.c b/cont.c
index 956f58e067..cd3dfba248 100644
--- a/cont.c
+++ b/cont.c
@@ -2465,17 +2465,24 @@ rb_fiber_backtrace_locations(int argc, VALUE *argv, VALUE fiber)
* mixed.
*
* * If the Fiber's lifecycle had started with transfer, it will never
- * be able to participate in yield/resume control passing, only
- * finish or transfer back.
+ * be able to yield or be resumed control passing, only
+ * finish or transfer back. (It still can resume other fibers that
+ * are allowed to be resumed.)
* * If the Fiber's lifecycle had started with resume, it can yield
* or transfer to another Fiber, but can receive control back only
* the way compatible with the way it was given away: if it had
* transferred, it only can be transferred back, and if it had
* yielded, it only can be resumed back. After that, it again can
- * transfer or yield
+ * transfer or yield.
*
* If those rules are broken FiberError is raised.
*
+ * For an individual Fiber design, yield/resume is more easy to use
+ * style (the Fiber just gives away control, it doesn't need to think
+ * about who the control is given to), while transfer is more flexible
+ * for complex cases, allowing to build arbitrary graphs of Fibers
+ * dependent on each other.
+ *
*
* Example:
*