From: Cyrill Gorcunov via Tarantool-patches <tarantool-patches@dev.tarantool.org> To: tml <tarantool-patches@dev.tarantool.org> Cc: Vladislav Shpilevoy <v.shpilevoy@tarantool.org> Subject: [Tarantool-patches] [PATCH v12 0/8] box: implement cmod Lua module Date: Mon, 18 Jan 2021 23:35:48 +0300 [thread overview] Message-ID: <20210118203556.281700-1-gorcunov@gmail.com> (raw) The cmod module provide a way to execute C stored procedures on read only nodes without registering them in `_func` system space. The series implements a bare minimum. Vlad, please take a look once time permit. v1-v3 are development ones and not sent. v5 (by vlad): - drop exists, list methods: they are redundant - rename cfunc to cbox - when create a function make it callable Lua object - initialize cbox out of modules - fix error in passing module name for reloading - make api been cbox.func.[create|drop] and cbox.module.reload - fix test for OSX sake v6 (by vlad): - move module handling into module_cache file. v7: - development v8: - use rbtree for function instance storage, since i don't like the idea of unexpected rehashing of values in case of massive number of functions allocated - use reference counter and free function instance if only load/unload are coupled - keep a pointer to the function inside Lua object so we don't need to lookup on every function call. this force us to implement __gc method - use new API and update docs v9: - development v10: - use hashes for function names lookup - simply function loads counting - use luaL_register_module and luaL_register_type for easier methods registering - carry functions as userdata object v11: - development v12: - switch to new API as been discussed in https://lists.tarantool.org/tarantool-patches/e186c454-6765-4776-6433-f3f791ff4c27@tarantool.org/ branch gorcunov/gh-4642-func-ro-12 issue https://github.com/tarantool/tarantool/issues/4642 Cyrill Gorcunov (8): box/func: factor out c function entry structure module_cache: move module handling into own subsystem module_cache: improve naming module_cache: direct update a cache value on reload module_cache: rename calls to ref in module structure module_cache: provide helpers to load and unload modules box/cmod: implement cmod Lua module test: box/cfunc -- add cmod test src/box/CMakeLists.txt | 2 + src/box/func.c | 491 +-------------------------- src/box/func.h | 41 +-- src/box/func_def.h | 14 - src/box/lua/cmod.c | 718 ++++++++++++++++++++++++++++++++++++++++ src/box/lua/cmod.h | 24 ++ src/box/lua/init.c | 2 + src/box/module_cache.c | 557 +++++++++++++++++++++++++++++++ src/box/module_cache.h | 158 +++++++++ test/box/CMakeLists.txt | 2 + test/box/cfunc1.c | 58 ++++ test/box/cfunc2.c | 132 ++++++++ test/box/cmod.result | 199 +++++++++++ test/box/cmod.test.lua | 70 ++++ test/box/suite.ini | 2 +- 15 files changed, 1933 insertions(+), 537 deletions(-) create mode 100644 src/box/lua/cmod.c create mode 100644 src/box/lua/cmod.h create mode 100644 src/box/module_cache.c create mode 100644 src/box/module_cache.h create mode 100644 test/box/cfunc1.c create mode 100644 test/box/cfunc2.c create mode 100644 test/box/cmod.result create mode 100644 test/box/cmod.test.lua base-commit: d712f83c105d107bac2491703fef5e154f54f55d -- 2.29.2
next reply other threads:[~2021-01-18 20:36 UTC|newest] Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-01-18 20:35 Cyrill Gorcunov via Tarantool-patches [this message] 2021-01-18 20:35 ` [Tarantool-patches] [PATCH v12 1/8] box/func: factor out c function entry structure Cyrill Gorcunov via Tarantool-patches 2021-01-18 20:35 ` [Tarantool-patches] [PATCH v12 2/8] module_cache: move module handling into own subsystem Cyrill Gorcunov via Tarantool-patches 2021-01-24 16:26 ` Vladislav Shpilevoy via Tarantool-patches 2021-01-25 8:52 ` Cyrill Gorcunov via Tarantool-patches 2021-01-18 20:35 ` [Tarantool-patches] [PATCH v12 3/8] module_cache: improve naming Cyrill Gorcunov via Tarantool-patches 2021-01-24 16:27 ` Vladislav Shpilevoy via Tarantool-patches 2021-01-24 22:32 ` Cyrill Gorcunov via Tarantool-patches 2021-01-30 18:53 ` Vladislav Shpilevoy via Tarantool-patches 2021-02-01 11:41 ` Cyrill Gorcunov via Tarantool-patches 2021-01-18 20:35 ` [Tarantool-patches] [PATCH v12 4/8] module_cache: direct update a cache value on reload Cyrill Gorcunov via Tarantool-patches 2021-01-19 12:46 ` Cyrill Gorcunov via Tarantool-patches 2021-01-24 16:27 ` Vladislav Shpilevoy via Tarantool-patches 2021-01-24 22:26 ` Cyrill Gorcunov via Tarantool-patches 2021-01-18 20:35 ` [Tarantool-patches] [PATCH v12 5/8] module_cache: rename calls to ref in module structure Cyrill Gorcunov via Tarantool-patches 2021-01-24 16:27 ` Vladislav Shpilevoy via Tarantool-patches 2021-01-25 10:29 ` Cyrill Gorcunov via Tarantool-patches 2021-01-18 20:35 ` [Tarantool-patches] [PATCH v12 6/8] module_cache: provide helpers to load and unload modules Cyrill Gorcunov via Tarantool-patches 2021-01-24 16:28 ` Vladislav Shpilevoy via Tarantool-patches 2021-01-18 20:35 ` [Tarantool-patches] [PATCH v12 7/8] box/cmod: implement cmod Lua module Cyrill Gorcunov via Tarantool-patches 2021-01-24 16:28 ` Vladislav Shpilevoy via Tarantool-patches 2021-01-25 16:50 ` Cyrill Gorcunov via Tarantool-patches 2021-01-30 18:53 ` Vladislav Shpilevoy via Tarantool-patches 2021-01-18 20:35 ` [Tarantool-patches] [PATCH v12 8/8] test: box/cfunc -- add cmod test Cyrill Gorcunov via Tarantool-patches 2021-01-24 16:28 ` Vladislav Shpilevoy via Tarantool-patches 2021-01-24 16:26 ` [Tarantool-patches] [PATCH v12 0/8] box: implement cmod Lua module Vladislav Shpilevoy via Tarantool-patches
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20210118203556.281700-1-gorcunov@gmail.com \ --to=tarantool-patches@dev.tarantool.org \ --cc=gorcunov@gmail.com \ --cc=v.shpilevoy@tarantool.org \ --subject='Re: [Tarantool-patches] [PATCH v12 0/8] box: implement cmod Lua module' \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox