cross-process

How to implement cross process lock in android?

℡╲_俬逩灬. 提交于 2020-01-20 05:22:14
问题 I'm writing a library project for multiple APPs to use. And for some reason, I must make a function mutual exclusion for different APPs, so I need a cross-process lock. But as far as I know, in android APPs can only write to it's own file's directory in internal storage, and external storage is unreliable because some device don't have one. So file lock seems not applicable for me, so is there any other way to implement cross-process lock? thanks~ 回答1: If you do not want to (or you can not)

How to implement cross process lock in android?

十年热恋 提交于 2020-01-20 05:22:08
问题 I'm writing a library project for multiple APPs to use. And for some reason, I must make a function mutual exclusion for different APPs, so I need a cross-process lock. But as far as I know, in android APPs can only write to it's own file's directory in internal storage, and external storage is unreliable because some device don't have one. So file lock seems not applicable for me, so is there any other way to implement cross-process lock? thanks~ 回答1: If you do not want to (or you can not)

Cross-process read-write synchronization primative in .NET?

房东的猫 提交于 2019-12-30 03:29:05
问题 Is there a read/write locking mechanism that works across processes (similar to Mutex, but read/write instead exclusive locking)? I would like to allow concurrent read access, but exclusive write access. 回答1: No. As Richard noted above, there is no such out of the box mechanism in .NET. This is how to implement it using a mutex and a semaphore. Method #1 is described in http://www.joecheng.com/blog/entries/Writinganinter-processRea.html, quoting: // create or open global mutex GlobalMutex

How to add button to other apps window title bar (XP/Vista)

好久不见. 提交于 2019-12-22 00:48:54
问题 I have the handler of an open window which wasn't necessarily open by my process. How can I add a button to that window and make the button call a certain application (.exe) when clicked? The button could be next to the system menu or the minimize button. This should work for both XP and Vista (a different approach for each version is OK). 回答1: The standard approach is to inject a DLL into the process with SetWindowsHookEx, hooking WH_CALLWNDPROC to monitor the WM_NCPAINT message. That used

Should I dispose a Mutex?

微笑、不失礼 提交于 2019-12-17 19:33:47
问题 I'm working on 2 Windows Services that have a common database which I want to lock (cross-process) with a system Mutex. Now I'm wondering whether it's ok to just call WaitOne() and ReleaseMutex() in a try-finally block or should I also dispose the Mutex (e.g. in a using block). If so I guess I should always catch the AbandonedMutexException on the WaitOne() method or am I wrong here? 回答1: A mutex is a Windows kernel object (here wrapped in a .NET object). As such, it is an unmanaged resource

Send fast textinput to another process (Window)

别等时光非礼了梦想. 提交于 2019-12-05 20:47:19
I am writing a C# WPF program which sends text messages to another program's window. I have a macro program as part of my keyboard drivers (Logitech g15) which already does this, though it does not send keystrokes directly to the process, but to the currently focused window. It works well but i need to be able to send inputs from my program as well. There are other people using the process so the input text messages from my program needs to be fast enough so that my text does not interfere with their input. The problem is that when I try to do this with a c# program I get too much delay. The

How to add button to other apps window title bar (XP/Vista)

拥有回忆 提交于 2019-12-04 19:23:10
I have the handler of an open window which wasn't necessarily open by my process. How can I add a button to that window and make the button call a certain application (.exe) when clicked? The button could be next to the system menu or the minimize button. This should work for both XP and Vista (a different approach for each version is OK). The standard approach is to inject a DLL into the process with SetWindowsHookEx, hooking WH_CALLWNDPROC to monitor the WM_NCPAINT message. That used to work pretty well but no more. Visual Styles and Vista UAC will make you grow a pretty long beard. Common

Named semaphores in Python?

こ雲淡風輕ζ 提交于 2019-11-30 18:27:20
I have a script in python which uses a resource which can not be used by more than a certain amount of concurrent scripts running. Classically, this would be solved by a named semaphores but I can not find those in the documentation of the multiprocessing module or threading . Am I missing something or are named semaphores not implemented / exposed by Python? and more importantly, if the answer is no, what is the best way to emulate one? Thanks, Boaz PS. For reasons which are not so relevant to this question, I can not aggregate the task to a continuously running process/daemon or work with

Is Boost IPC any good? [closed]

左心房为你撑大大i 提交于 2019-11-30 09:04:09
My default choice for cross-platform IPC would be boost, but I saw it criticised in two different forums when I asked about it and this concerned me. Perhaps this was simply a coincidence, so what are the thoughts on boost IPC and choosing a cross-platform C++ IPC library in general? For Windows dev we're using VC++ 2008 for reference. edit: here is an example of comments I've seen made (can't find them all right now): for boost, it's crap. At least on windows. The Mutexes don't use WinAPI, instead they create it's own File-Based implementation (WinAPI = Kernel-Objects). If your Program

Named semaphores in Python?

偶尔善良 提交于 2019-11-30 02:39:06
问题 I have a script in python which uses a resource which can not be used by more than a certain amount of concurrent scripts running. Classically, this would be solved by a named semaphores but I can not find those in the documentation of the multiprocessing module or threading . Am I missing something or are named semaphores not implemented / exposed by Python? and more importantly, if the answer is no, what is the best way to emulate one? Thanks, Boaz PS. For reasons which are not so relevant