interprocess

Create a locked file with boost::interprocess::file_lock

丶灬走出姿态 提交于 2019-12-12 10:45:48
问题 I'd like to use boost::interprocess::file_lock to ensure that files that are written to a directory x by process P1 are not read by process P2 until they are complete. To do this, I'd like to have P1 lock the files with boost::interprocess::file_lock while it's writing them, and then unlock them when it's done. Then P2 can just skip over (and come back to) any files that are locked. The problem I'm having is that it appears that boost::interprocess::file_lock only lets you lock files that

Is communication between two ruby processes possible/easy?

感情迁移 提交于 2019-12-12 07:38:27
问题 If I have a ruby script Daemon that, as it's name implies, runs as a daemon, monitoring parts of the system and able to perform commands which require authentication, for example changing permissions, is there an easy way to have a second ruby script, say client , communicate to that script and send it commands / ask for information? I'm looking for a built in ruby way of doing this, I'd prefer to avoid building my own server protocol here. 回答1: Ruby provides many mechanisms for this

Limiting .NET Class to single object instance on computer boundary => “inter-process singleton”

天大地大妈咪最大 提交于 2019-12-11 16:35:33
问题 I want to have one object of some .NET class used by multiple processes on same computer. Having Application domains, it is not easily possible to move across that boundary, but memory-mapped files in .NET 4.0 should ease that task in some way. Until .NET 4.0 comes in final release... Is it possible to make some kind of "inter-process singleton" in C#? 回答1: Yes you can create a .Net Remoting singleton in one process, and expose it to the other processes running on the same machine via

Can boost's interprocess segment manager allocators be themselves shared with other processes?

£可爱£侵袭症+ 提交于 2019-12-11 08:13:23
问题 I am creating a shared interprocess map using boost::interprocess. For this I create an allocator from the segment_manager of the shared memory segment where the map is located. The element value type of the map is a basic_string which is itself templated to use a char allocator created from the same segment manager. In one process I create the map and in the other I search for an item using the maps iterator in that process and in some cases I call map::erase with the iterator. This causes

Inter Application Communication in Ios

故事扮演 提交于 2019-12-11 08:11:58
问题 I already go Inter application communication in iphone but is it possible to communicate two ios apps. or alteast i want notify second app when something happens(event) in First app 回答1: Read this for more information on inter-app communication. This requires though that the other developer of the app you want to communicate with, handles a URL Scheme and you know what it is. Or that the developer supports the "share"capability in iOS. If you develop the apps that communicate, you should

boost::interprocess Containers of containers NOT in shared memory copy

人走茶凉 提交于 2019-12-11 07:53:41
问题 Based on a previous question boost::interprocess Containers of containers NOT in shared memory I am able to create objects in the shared memory and on the heap. What I want now is a template deep copy function to copy between heap an shm usable with all interprocess vectors independent to the allocator. #include <boost/interprocess/containers/vector.hpp> #include <boost/interprocess/allocators/allocator.hpp> #include <boost/interprocess/managed_shared_memory.hpp> #include <boost/range

Accessing Elements from Other Processes

让人想犯罪 __ 提交于 2019-12-11 07:28:04
问题 I would like to “read” information from a window not related to my program. If I have a process ID and a window handle: Process Proc = Process.GetProcessById(ProcID); IntPtr hdl = Proc.MainWindowHandle; And I have information from spy++ telling me that the control-ID of the element I’m interested in is 00000003EA, how can I access it with C#? Thanks for your help! Edit_____________________________________ In case anyone is interested, this is how I got it working: Process p = Process

How do I create synchronization mechanisms in managed shared memory segments?

元气小坏坏 提交于 2019-12-11 04:49:14
问题 I'm trying to have 2 processes communicate via an stl container - so I've decided to use the managed shared memory. I'm trying to implement some synchronisation between them - an interprocess_mutex for a start with a scoped_lock - but I'm not having much luck. How is it supposed to be done? 回答1: I think the best solution is a container handler, and all access (getter/setter) to the container through the handler. So in this handler you could implement the synchronisation easily. Salu2. 来源:

RPC Authentication

大憨熊 提交于 2019-12-11 03:14:29
问题 I'm working on communicating data on local machine using Remote Procedure Calls ( RPC ). My requirement is use RPC to communicate data between two processed, but server should authenticate client by some means. I came across RpcBindingSetAuthInfo which set authentication and authorization information. The fourth parameter is authentication service which can be anything from http://msdn.microsoft.com/en-us/library/windows/desktop/aa373556(v=vs.85).aspx WINNT authentication is not applicable in

How to solve “The ChannelDispatcher is unable to open its IChannelListener” error?

夙愿已清 提交于 2019-12-09 02:34:45
问题 I'm trying to communicate between WCF hosted in Windows Service and my service GUI. The problem is when I'm trying to execute OperationContract method I'm getting "The ChannelDispatcher at 'net.tcp://localhost:7771/MyService' with contract(s) '"IContract"' is unable to open its IChannelListener." My app.conf looks like that: <configuration> <system.serviceModel> <bindings> <netTcpBinding> <binding name="netTcpBinding"> <security> <transport protectionLevel="EncryptAndSign" /> </security> <