From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id EB7036FC8B; Fri, 23 Apr 2021 02:05:59 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org EB7036FC8B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1619132760; bh=s2vSpwtkmEIQNudonTWepjAX0HwZEJSitk2ehT1JPsc=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=f/HbhQEy4xCaUiBuKvTZQ/8k1Gx36KdXAWBcbJw4H+TkArIKf2l2DOT0WYSzHs/KY 8qZvQbzwISJ31gVq6wwzB97SpXHK2uhBxzJTgCKjNNDmV6jGibOzbwrLHFPntx6oqb 7FPhqS4Ju33+gzOorHZfyK2q/1TGfKTlzymTn/60= Received: from smtpng2.m.smailru.net (smtpng2.m.smailru.net [94.100.179.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id D942E6EC5E for ; Fri, 23 Apr 2021 02:05:57 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org D942E6EC5E Received: by smtpng2.m.smailru.net with esmtpa (envelope-from ) id 1lZiOS-000482-TG; Fri, 23 Apr 2021 02:05:57 +0300 To: tarantool-patches@dev.tarantool.org, gorcunov@gmail.com, sergepetrenko@tarantool.org Date: Fri, 23 Apr 2021 01:05:53 +0200 Message-Id: X-Mailer: git-send-email 2.24.3 (Apple Git-128) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9203E2ABA940B75487ADF04F292A7BD7756ABB318AC2F9BF9182A05F53808504039B97936DF7196AE677916FE29C51E2D09C11AE9283CFF4934B59BA4BCEB73A7 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE72E0BB8D059315229EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637317AD06F2A8D0AEF8638F802B75D45FF914D58D5BE9E6BC1A93B80C6DEB9DEE97C6FB206A91F05B232C83319B17779C48176042661187E7798738A72DB41484ED2E47CDBA5A96583C09775C1D3CA48CF90D92131081DE748117882F4460429724CE54428C33FAD30A8DF7F3B2552694AC26CFBAC0749D213D2E47CDBA5A9658378DA827A17800CE7BEE62E5629C982429FA2833FD35BB23DF004C906525384302BEBFE083D3B9BA71A620F70A64A45A98AA50765F79006372E808ACE2090B5E1725E5C173C3A84C3C5EA940A35A165FF2DBA43225CD8A89F83C798A30B85E16BCE5475246E174218B5C8C57E37DE458BEDA766A37F9254B7 X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A2AD77751E876CB595E8F7B195E1C97831600870716715CFB668DC494EC0BC7860 X-C1DE0DAB: C20DE7B7AB408E4181F030C43753B8186998911F362727C414F749A5E30D975C3E7AEEB2EA3DACB3DA4E96A77E3A2ED46AF6BC952E6A91819C2B6934AE262D3EE7EAB7254005DCEDB7EFC714DBEEC1D51E0A4E2319210D9B64D260DF9561598F01A9E91200F654B0279E343DB675BB2F8E8E86DC7131B365E7726E8460B7C23C X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34E318F287A436F24C532358C48585FEA8D59FB27D32D94FAE8A392D8E1870D443E014CEA84B0B76BD1D7E09C32AA3244CC8DACFC7F99A63718E96131FA287940330363D8B7DA7DD44FACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojMA4lh0BuVjPP8Wor+L/v0Q== X-Mailru-Sender: 689FA8AB762F73936BC43F508A063822DAAB987329323564CEA527528FA52E183841015FED1DE5223CC9A89AB576DD93FB559BB5D741EB963CF37A108A312F5C27E8A8C3839CE0E267EA787935ED9F1B X-Mras: Ok Subject: [Tarantool-patches] [PATCH 0/2] fiber_touch() and fiber_continue() X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Vladislav Shpilevoy via Tarantool-patches Reply-To: Vladislav Shpilevoy Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" 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)