ipc

Communicate with a WallpaperService

依然范特西╮ 提交于 2019-12-22 19:14:57
问题 Is there any way to directly communicate with a WallpaperService from an Activity ? It doesn't look like I can use the normal service communication classes because the onBind method is declared final in the WallpaperService class I'm extending. Worth noting that I'm referring to my WallpaperService not any . Any workarounds if this isn't possible? 回答1: My solution was to use local sockets. I created an instance of a LocalServerSocket in the constructor of my wallpaper's Engine . Here's a

How to send integer with message queue with POSIX API in linux?

不打扰是莪最后的温柔 提交于 2019-12-22 18:12:59
问题 I try to send integer by msg queue but the function mq_send(mq, &val , sizeof(val), 0); is working for only char type pointer so is there any way to send integer to queue with another function or same function. Regards... 回答1: Do not read the char* in this case as the only allowed datatype. Many *ix API use char as a generic buffer pointer. View the interface therefore as taking a pointer to buffer and the size of the buffer. That buffer can be anything you like, from a single int, to a

IPC via mmap'ed file: should atomics and/or volatile be used?

怎甘沉沦 提交于 2019-12-22 13:46:57
问题 I use a mmap'ed file to share data between processes. The code is like this: struct Shared { int Data; }; int file = open("file.dat", O_RDWR); Shared* shared = static_cast<Shared*>( mmap(0, sizeof(Shared), PROT_READ | PROT_WRITE, MAP_SHARED | MAP_POPULATE, file, 0)); shared->Data++; The questions are: Should I use volatile qualifier ( volatile int Data )? Should I use atomic operations on the shared data ( __sync_fetch_and_add(&(shared->Data), 1) )? For future reference: Volatile: Almost

What can I do to target API in .NET 1.1 from .NET 4.0 (VS2010) project?

南笙酒味 提交于 2019-12-22 13:31:23
问题 I developed programs in C# .NET 4.0 using 3d-party libraries in .NET 4.0 and now I was asked to target a 3d-party program that has API only in .NET 1.1 I overlooked some previous discussions telling that it is impossible: MSDN .NET Framework Multi-Targeting Packs for Visual Studio 2010 SO Can I still target .NET Framework 1.1 in VisualStudio 2010? etc. This is weird that I cannot acsess previous .NET from a .NET (4.0). The article: Working with .NET 1.1 in Visual Studio 2008 and Team Server

What can I do to target API in .NET 1.1 from .NET 4.0 (VS2010) project?

╄→尐↘猪︶ㄣ 提交于 2019-12-22 13:31:02
问题 I developed programs in C# .NET 4.0 using 3d-party libraries in .NET 4.0 and now I was asked to target a 3d-party program that has API only in .NET 1.1 I overlooked some previous discussions telling that it is impossible: MSDN .NET Framework Multi-Targeting Packs for Visual Studio 2010 SO Can I still target .NET Framework 1.1 in VisualStudio 2010? etc. This is weird that I cannot acsess previous .NET from a .NET (4.0). The article: Working with .NET 1.1 in Visual Studio 2008 and Team Server

What are the ways that signals can interfere with pipe communication?

为君一笑 提交于 2019-12-22 12:52:17
问题 I don't know anything about signals, and only a little about pipes. From the comments on zdim's answer here it seems that signals may interfere with pipe communication between parent and child processes. I was told that, if you're using IO::Select and sysread, then the exit of a child process could somehow mess up the behavior of IO::Select::can_read , especially if there are multiple child processes. Please describe how to account for signals when using pipes? The below code is an example

using multiple instances of shared memory at once

不问归期 提交于 2019-12-22 10:48:53
问题 to transport a video-stream between the recording program and the display program (which cannot be the same) I use shared memory. To synch the access I've put together a class, which wraps a shared_memory_object, a mapped_region and an interprocess_sharable_mutex (all of boost::interprocess) I wrote 2 construtors, one for the "Host"-side, and one for the "Client"-side. When I use my class to transport one video-stream it works perfectly. But when I try to transport two video streams there are

Interprocess communication via Pipes

你说的曾经没有我的故事 提交于 2019-12-22 09:28:06
问题 It is known that during Interprocess Communication in Linux, the processes communicate with each other through a special file named as "Pipe" . It is also known that the the operations performed on that file is write by one process and read by one process in order to communicate with each other. Now, the question is : Do these write and read operations are performed in parallel during the communication (operations are executed parallely) ? and if not than, What happens when one of the process

Getting data from an Unbound Service in Android

你离开我真会死。 提交于 2019-12-22 08:55:21
问题 I currently I have an unbound service that is running continually grabbing my gps position that I start on boot. I then have an app that is suppose to plot where I've been by pulling data from the service. I can't bind the the service to talk to it or it will be destroyed once I close the app. Is there any good way to get data from an unbound service or keep a bound service from dying once I unbind it? Cheers! :) 回答1: There is a workaround for keeping your service alive. Call your service by

How to send a data.frame from R to Q/KDB?

假装没事ソ 提交于 2019-12-22 08:33:59
问题 I have a large data.frame (15 columns and 100,000 rows) in an existing R session that I want to send to a Q/KDB instance. From KDB's cookbook, the possible solutions are: RServer for Q: use KDB to create new R instance which shares memory space. This doesn't work because my data is in an existing instance of R. RServe: run an R server and use TCP/IP to communicate with Q/KDB client. This does not work, because as per RServe's documentation, " every connection has a separate workspace and