ipc

How do I do a non-blocking IPC read on Windows?

孤街浪徒 提交于 2019-12-21 13:06:30
问题 I have a Perl script that uses an external tool (cleartool) to gather information about a list of files. I want to use IPC to avoid spawning a new process for each file: use IPC::Open2; my ($cin, $cout); my $child = open2($cout, $cin, 'cleartool'); Commands that return single-lines work well. e.g. print $cin "describe -short $file\n"; my $description = <$cout>; Commands that return multiple lines have me at a dead end for how to consume the entire response without getting hung up by a

Is it possible to use function pointers across processes?

我怕爱的太早我们不能终老 提交于 2019-12-21 11:32:08
问题 I'm aware that each process creates it's own memory address space, however I was wondering, If Process A was to have a function like : int DoStuff() { return 1; } and a pointer typedef like : typedef int(DoStuff_f*)(); and a getter function like : DoStuff_f * getDoStuff() { return DoStuff; } and a magical way to communicate with Process B via... say boost::interprocess would it be possible to pass the function pointer to process B and call Process A's DoStuff from Process B directly? 回答1: No.

Is it possible to use function pointers across processes?

烈酒焚心 提交于 2019-12-21 11:32:05
问题 I'm aware that each process creates it's own memory address space, however I was wondering, If Process A was to have a function like : int DoStuff() { return 1; } and a pointer typedef like : typedef int(DoStuff_f*)(); and a getter function like : DoStuff_f * getDoStuff() { return DoStuff; } and a magical way to communicate with Process B via... say boost::interprocess would it be possible to pass the function pointer to process B and call Process A's DoStuff from Process B directly? 回答1: No.

AF_UNIX equivalent for Windows [duplicate]

限于喜欢 提交于 2019-12-21 07:48:27
问题 This question already has answers here : AF_UNIX in windows (3 answers) Closed last year . I want to know how to use something that behaves like Unix Domain Socket on Windows. The behaviour is: A process will be a "server" and receive connections from other processes and it can keep and use connections from different processes, as a TCP socket does. IP socket is not a solution, because it requires to choose a port, processes from other applications may need the chosen port, and the open port

How do you do interprocess communication (IPC) in Rust?

一个人想着一个人 提交于 2019-12-21 07:43:42
问题 Is there part of the standard library for this? I've been digging around, but I can't see anything immediately obvious that implements it, or anything on Process that would let you do this? Did I miss it? Or do I have to do some C-wrapper work for this functionality? (if so, is it 'safe' to serialize an object that is Send and pass it another process, then deserialize it there? That's what Send means right?) 回答1: There is no single blessed way to do interprocess communication in Rust. You

How do you do interprocess communication (IPC) in Rust?

安稳与你 提交于 2019-12-21 07:43:17
问题 Is there part of the standard library for this? I've been digging around, but I can't see anything immediately obvious that implements it, or anything on Process that would let you do this? Did I miss it? Or do I have to do some C-wrapper work for this functionality? (if so, is it 'safe' to serialize an object that is Send and pass it another process, then deserialize it there? That's what Send means right?) 回答1: There is no single blessed way to do interprocess communication in Rust. You

Why are pipes considered dangerous to use in Windows/unix/linux?

两盒软妹~` 提交于 2019-12-21 04:42:30
问题 Why are pipes considered dangerous to use? What can be done to avoid these security issues? I'm mostly interested in Windows, but if you have other OS information, please provide. 回答1: (assuming you're talking about Unix named pipes from the mention of 'c' and 'IPC'. Windows named pipes work somewhat differently) Anyone with permissions can write to a named pipe, so you have to be careful with permissions and locking (see flock()). If an application trusts the input it's getting from the

Resource cleanup on abnormal process termination

前提是你 提交于 2019-12-21 04:28:14
问题 My question is, when a process terminates abnormally (via a signal, it could be SIGKILL so we can't intercept it), is there any guaranteed order or atomicity in which its resources are released? In particular, i m interested in file locks and shared memory. For example: 1) If the process is holding locks on 2 files and terminates abnormally, is it at all possible that another process trying to lock the same files sees one file being locked and another being unlocked? Or is the process of

Can I pass an object to another process just passing its' pointer to a shared memory?

给你一囗甜甜゛ 提交于 2019-12-21 04:12:52
问题 I have a very complicated class(it has unordered_map and so on on inside it) and I want to share an object of it withit two my processes. Can I simply pass just a pointer to it from one process to another? I think, no, but hope to hear "Yes!". If "no", I'd be grateful to see any links how to cope in such cases. I need to have only one instance of this object for all processes because it's very large and all of the processes will work woth it for read only. 回答1: No, process do not ( naturally

Inter-plugin communication in Eclipse

こ雲淡風輕ζ 提交于 2019-12-21 02:44:06
问题 Is it possible to create Eclipse plugins that auto-discover eachother? I am developing a set of plugins that need to operate in two primary situations: individually in concert with each other. When run individually, the plugins should "just work" but when in concert, they will be sharing some of the same model content, and one of the plugins should present the user with a list of other plugins to share content with. eg: Foo Plugin detected the following plugins it can share ontologies with: [