ipc

msgrcv - SA_RESTART flag doesn't work

无人久伴 提交于 2019-12-23 21:11:51
问题 There is something wrong with my code that uses IPC queue to communicate between threads. I need to handle SIGINT safely - let program finish all active threads when SIGINT appeared before shutting down. Though, I have serious problem of finding solution because even with sigaction for SIGINT with flag SA_RESTART the msgrcv function is getting EINTR error. My question is - is there any way to avoid EINTR with msgrcv function other than specifying the error condition in some "if" such as: if

Get AppDomain for another .NET framework process

徘徊边缘 提交于 2019-12-23 20:24:11
问题 I am trying to get the AppDomain for all the .NET Framework processes running on my machine. Any advice on how to do that? 回答1: Im not entirely clear on what you are trying to do, but if you want to enumerate all running AppDomains by attaching Visual Studio to a process, see this link: Jack Gudenkauf "Enumerating AppDomains" In that same vein, if you want to do this AT RUNTIME (without Visual Studio) then you will probably need to include a managed debugger in your program which will allow

Why can't get data from tail -f?

混江龙づ霸主 提交于 2019-12-23 19:05:55
问题 In my program I'm redirecting output of child process to pipe and in parent getting this result and doing something (this is not important). But my program doesn't work when I'm using tail -f test.txt command and doesn't recieve any data during tail is running, and getting this data only after tail is finished (or killed). At first I have thought that problem was that tail -f doesn't flushing and that's why no data I can recieve, but when I have tried to redirect output of tail -f to some

Is UDP a reliable protocol for IPC?

我与影子孤独终老i 提交于 2019-12-23 17:30:49
问题 If I use UDP purely for inter-process communication (i.e., in 1 system, with no network involved ), can I consider it to be reliable? Or do I still need to worry about packets getting dropped, etc.? Note that this is a practical question, not a theoretical one. If the answer differs across OSes, please explain how, in particular including Windows, Linux, and Mac. Edit: Nope, it's not reliable -- example below. Thanks to the current answer for pointing me in the right direction. This code

Inter Process Communication using vbscript

孤人 提交于 2019-12-23 16:56:38
问题 I need to send data form one process to another. Constraints : Sender process is very expensive call. It needs to be done using vbscipt. For Sender process,this data transferring is an additional work.It shouldn't get affected much by this feature. There are around 1000 threads in a sender process in 4-5 mins. Faster IPC is important.If it can be done asynchronoulsy it will be better. I read about the named pipe.Is it possible to open a named pipe using vbscript .Also is there any other

Preventing SIGPIPE

余生颓废 提交于 2019-12-23 16:23:26
问题 Let's consider the following example. I have a parent process that creates a pipe, spawns a child and read the child's standard output using this pipe. At some point, the parent process is no longer interested in the child's output, and closes the read end of the pipe. Apparently, if the child keeps writing, will this result in the child process receiving a SIGPIPE signal. Question: is there a way to redirect the child's output to /dev/null so that it still keeps running and producing output,

Is there only one Unix Domain Socket in the communication between two processes?

穿精又带淫゛_ 提交于 2019-12-23 16:16:00
问题 There are two kinds of sockets: network sockets and Unix Domain Sockets. When two processes communicate using network sockets, each process creates its own network socket, and the processes communicate by connection between their sockets. There are two sockets, each belonging to a different process, being the connection endpoint of each process When two processes communicate using Unix Domain sockets, a Unix Domain socket is addressed by a filename in the filesystem. Does that imply the two

How can I monitor an application crash from a separate process

你。 提交于 2019-12-23 15:58:12
问题 I have a certain .net application that occasionally crashes with one of the following windows errors: [application name] has encountered a problem and needs to close. We are sorry for the inconvenience. or [application name] has stopped working I want to monitor this app from another .net process, prevent showing the default windows error report dialog, and do my own error processing. Is there a way I can detect that the other app has crashed? And can I prevent or hide the default error

How can I monitor an application crash from a separate process

耗尽温柔 提交于 2019-12-23 15:54:57
问题 I have a certain .net application that occasionally crashes with one of the following windows errors: [application name] has encountered a problem and needs to close. We are sorry for the inconvenience. or [application name] has stopped working I want to monitor this app from another .net process, prevent showing the default windows error report dialog, and do my own error processing. Is there a way I can detect that the other app has crashed? And can I prevent or hide the default error

Send data from Windows Forms application to Window Service

放肆的年华 提交于 2019-12-23 13:08:53
问题 I have a Windows Form where a user can enter data. This data, a complex struct, has to be communicated to a Window Service. How can I solve this problem in C#? 回答1: There are four ways to Interact with the windows service. Through Windows Registry Through WMI Through Command Through interop Here you can get more Details. 回答2: If you Right click on the References section in the solution explorer, you will see a menu item for adding a service reference. Once you set that up, you would just