[Tarantool-patches] [PATCH 0/2] fiber_touch() and fiber_continue()

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Fri Apr 23 02:05:53 MSK 2021


The patchset introduces 2 alternatives to fiber_wakeup(): fiber_touch() and
fiber_continue(). Touch behaves like wakeup but is NOP on the current fiber -
sometimes it does not matter in the code. Continue works like wakeup but ensures
the fiber is not the current one - helps to catch errors where it is not so,
earlier than the awake fiber would try to yield.

I couldn't find better names. Tried fiber_wake() instead of fiber_touch() but it
looks too similar to fiber_wakeup(). Tried fiber_go(), but it looks too similar
to fiber_gc(), and just looks more strange than touch.

Branch: http://github.com/tarantool/tarantool/tree/gerold103/gh-5292-fiber-wakeup-nop
Issue: https://github.com/tarantool/tarantool/issues/5292

Vladislav Shpilevoy (2):
  fiber: introduce fiber_touch and fiber_continue
  fiber: use fiber_touch and fiber_continue

 src/box/applier.cc           |   4 +-
 src/box/box.cc               |   2 +-
 src/box/gc.c                 |  12 ++--
 src/box/journal.c            |   4 +-
 src/box/memtx_engine.c       |   2 +-
 src/box/raft.c               |   9 ++-
 src/box/recovery.cc          |   2 +-
 src/box/txn.c                |   8 +--
 src/box/txn_limbo.c          |   9 ++-
 src/box/vy_log.c             |   2 +-
 src/box/vy_quota.c           |   2 +-
 src/box/vy_scheduler.c       |   2 +-
 src/lib/core/cbus.c          |   2 +-
 src/lib/core/coio.cc         |   2 +-
 src/lib/core/coio_file.c     |   2 +-
 src/lib/core/coio_task.c     |   2 +-
 src/lib/core/fiber.c         | 107 +++++++++++++++++++++--------------
 src/lib/core/fiber.h         |  26 +++++++++
 src/lib/core/fiber_channel.c |   4 +-
 src/lib/core/fiber_cond.c    |   4 +-
 src/lib/core/fiber_cond.h    |   7 ++-
 src/lib/core/fiber_pool.c    |   2 +-
 src/lib/core/latch.h         |   2 +-
 src/lib/swim/swim.c          |   3 +-
 src/lua/fiber.c              |   2 +-
 test/unit/fiber.cc           |  64 +++++++++++++++++++++
 test/unit/fiber.result       |   4 ++
 27 files changed, 200 insertions(+), 91 deletions(-)

-- 
2.24.3 (Apple Git-128)



More information about the Tarantool-patches mailing list