There is my productive Function and i wanted to keep extra impact minimal on my codebase.
The RPC sounds very promising, is that how two Apps would speak? Is Thread Local Storage expanded by some Rust concept or how to imagine the callstacks and handover?
Even after reading your post three times I'm over, I'm still somewhat confused.
Do you want/need the program #2 to call into a function from a program #1? If so, is it only meant to happen while the program #1 is executing? Do you need [A] the program #1 to call into a shutdown or a reboot on behalf of the program #2, or [B] for the program #2 to be able to call into any of the two functions whenever it needs to do so?
For [A], look into IPC. You can use a named pipe, turn your #1 into a TCP listener / HTTP server for the #2 to connect to as a client, listen for file system events on any given directory, and much more.
For [B], is your program #2 aware/able to instantiate an Acpi on its own? If so, does the Acpi itself have a consistent memory layout, i.e. #[repr(C)]? Or do you want the #2 to be able to call any of the two functions without any awareness of the types used in the #1?
You'll have to build a decent chunk of the #2 - which has anything to do with reboot or shutdown - as a shared/dynamic lib. There are ways around reusing executables' symbols as if they were loaded from an .so/.dll, if my memory serves me well; yet they are about as erratic as they are a nightmare to work with, in general.
Given the following bits, though:
Summary
mentioned without any context, I have the slightest of suspicion that you might have spent a bit too much time "speaking" to an LLM, as opposed to digging through and/or educating yourself on the internals/lower level side of things, to begin with. Reading up / prompting a GPT on the difference between executables, processes, threads, call stacks, and libraries might help. Learning a bit about IPC could clear things up. Watching a few things about the basics of operating systems, mayhaps.
If my doubts are totally way off and it's just a language barrier, I do excuse myself in advance. It's getting quite hard to tell the difference in between a person that has all of their fundamentals in order, and people who are overly excited to throw around a bunch of technical terms they can't be bothered to look up beforehand in attempt to seem way out of their own league, these days.
It has this name, and while my network attempt worked and the filesystem attempt worked as well, I want to signal the other app indirectly:
“Here is your single parameter. Execute.”
Now I’ve clearly found that files and networks work, unless I stream, maybe. Or is that already a platform-specific question?
Maybe a file can just be a stream and does not need to go all the way to disk. Maybe networking can run on a “virtual” localhost and does not need to go all the way to the NIC.
So I believe I have discovered IPC, but I do not yet understand how the data flows for my idea.
I guess the ACPI needs to be an API, and IPC can send a mail or message into a box that my process needs to poll?
Networking on localhost is basically the same speed as any other IPC other than shared memory.
You can really just use HTTP. It has so much features built in and lots of library support . Like waiting for an operation to complete and spawning parallel tasks.
The only downside of HTTP is if you send really small messages really fast. But even then you can just use websockets which have a very slim protocol on top of TCP