Time Nick Message 00:36 * mtvisitor reviewed the debug.txt file of the luanti game engine on his offline version. 00:37 mtvisitor https://content.luanti.org/packages/Calinou/moreblocks/ 00:37 mtvisitor It breaks stairs and slabs once disabled - and there doesn't seem to be the will to fix it . 00:40 mtvisitor when uninstall some mod(s), there will be some unexpected error after re-login the game. 03:33 cheapie So a question came up elsewhere... someone built a church with some bells made of mese, and now we're wondering what a bell made of mese would sound like anyway 03:33 cheapie My guess is https://www.youtube.com/watch?v=X9qvR2ih8C0&t=6 05:14 whosit should core.ipc_cas() work for table references? (currently ipc_get() will just return new table each time, even if stored table is unchanged) 05:18 whosit I do realize that it gets de-serialized each time, and each thread will have different values anyway... but if get() would return same reference per-thread, that would at least somewhat work? 05:22 whosit at the moment, to use CAS with a table, I have to provide a level of indirection, like: ipc_set(new_table_address, new_table); ipc_cas(table_pointer, old_table_address, new_table_address) ... 05:24 whosit it's a little bit weird, but works, I guess... 05:56 [MatrxMT] IIRC the serialization format in the IPC store is not related to the Lua environment at all; and I don't think IPC CAS is intended to be used with tables 05:57 [MatrxMT] although you could make it work by defining the __eq metamethod 06:02 [MatrxMT] IMO having ipc_get return the same reference for tables can become a footgun; if you (accidentally?) modify the table the values for the IPC store goes out of sync 06:05 whosit true... 06:06 whosit maybe IPC API should provide something like channels for sending messages to/from async threads - that's what I was trying to do when I froze my async by trying to CAS a table :p 06:13 whosit I did implement something like FIFO on top of IPC functions.. but it's horrible in every way, I feel 06:36 whosit I tried registering metatable and using __eq, and it does work. 08:30 sfan5 whosit: nothing in the ipc api works with references 08:32 sfan5 if you want to implement something like a channel on top of the ipc, having to use some indirection is to be expected 08:34 sfan5 I'm curious to know what your use case for channels looks like tho 08:59 whosit lots of different mods (areas, mail...) like to write complex and large json files to persist some state, as those grow, time for serialization and IO grows... 08:59 whosit ideally, all this stuff should use an sql database, but ... anyway 09:01 whosit I tried writing a mod that will provide a "json" object to a mod, and this json/table would transparently mirror the table on async thread; and async will do the (periodid or on demand) serialization and writes to disk 09:01 sfan5 so basically you needed a queue? 09:02 whosit yes 09:04 whosit async thread just waits for ipc_poll(task_count, timeout); then pops all update messages in a loop, and unsets the task count... 09:05 whosit and fifo is built on top of "perfix:task_XXX" keys... 09:05 whosit just having a queue would be much cleaner :p 09:06 sfan5 it sounds like you're blocking an async worker with your task. that's not supported. 09:06 whosit it's working though X) 09:07 sfan5 it will break async tasks for everyone else if the machine has a low enough core count 09:08 whosit whole idea is to keep the copy of the structure in async worker's memory, to avoid repeated serialization 09:08 whosit I know it's horrible, that why I dream of having proper sql one day :3 09:10 whosit creating and destroying async threads each time + not having real shared memory - makes them much less useful 09:14 whosit modern OS would not have problems with many threads that just sleeping and waiting for a message from queue... 09:15 sfan5 here's a secret: the async thread are permanent, it's just random which one your job gets assigned to 09:17 whosit my prototype can only spawn one, I set an IPC key to make sure 09:18 whosit and I call handle_async only once after the mod is loaded 09:19 whosit I can show the horrible monster I've made :p (if that will help preventing more monsters from appearing) 09:33 whosit anyway: https://github.com/yl-whosit/async_json 09:33 whosit I know it's wrong and broken in many ways :p 10:36 MinetestBot 02[git] 04MoNTE48 -> 03luanti-org/minetest_game: Creative: release memory when player leaves 13c6fabe4 https://github.com/luanti-org/minetest_game/commit/c6fabe4734e4a39f7a398154161d39a6df7ad45f (152025-04-12T10:35:21Z)