when people say things like "ugh tokio just does async filesystem i/o in a blocking thread" as if the problem is tokio using a blocking thread for local filesystem i/o and not the initial proposal to use async for local filesystem i/o while expecting to get good performance. the filesystem is not like the network!
Post
the problem with blocking threads is that they're os threads and linux has cooties
anyway i figured out how to make this ring buffer interface with an os pipe
an actual good use case for vmsplice()
i am aware of the incredible safety concerns with it. using vmsplice() is one of the few times i have seen garbage in my bytes unintentionally. it has a very tricky post-condition in which i believe if you touch the memory range you sent (even if they're your bytes! that you allocated!) before the other end of the pipe reads out all the data you sent then you have to wipe the floors for linus torvalds for a millennia to make up for your misdeeds
@hipsterelectron I know `mmap` requires page alignment for perfectly good reasons that can't be changed realistically, but if one could `mmap` arbitrary byte ranges it would solve *so* many problems with zero copy IPC and syscalls.
@heptapodEnthusiast this could be a fun game show idea. give os devs a proposal that could never work but would be cool as shit and give them 30 minutes to brainstorm an implementation
@heptapodEnthusiast linus could be gordon ramsay
there's some terminology about memory pledging that i was supposed to have read in the man page. the man page assumed nobody would ever think to use vmsplice() between pipes with both ends in use by the same fucking process
so i'm here now for my sins https://github.com/zip-rs/zip2/pull/236 making my amends to linus torvalds. planning my escape
@hipsterelectron Still dreaming of kvmfork() and the potential for distributed ultra-efficient micro-VMs. Really, kinda “ghost in the shell” if you think about it.
@promovicz https://docs.kernel.org/bpf/bpf_design_QA.html this page is cute. not what you're talking about at all
@hipsterelectron lol. maybe bpf will beat wasm. funnier things have happened.
@promovicz this is why i declared war on andy wingo https://wingolog.org/archives/2024/01/08/missing-the-point-of-webassembly
@hipsterelectron “tfw, the forrest fire doesn’t burn where you want.”