shared

C - shared memory - dynamic array inside shared struct

泄露秘密 提交于 2019-11-29 06:10:51
i'm trying to share a struct like this example: typedef struct { int* a; int b; int c; } ex; between processes, the problem is that when I initialize 'a' with a malloc, it becomes private to the heap of the process that do this(or at least i think this is what happens). Is there any way to create a shared memory (with shmget, shmat) with this struct that works? EDIT: I'm working on Linux. EDIT: I have a process that initialize the buffer like this: key_t key = ftok("gr", 'p'); int mid = shmget(key, sizeof(ex), IPC_CREAT | 0666); ex* e = NULL; status b_status = init(&e, 8); //init gives initial

User preferences file vs App preferences file

断了今生、忘了曾经 提交于 2019-11-29 02:06:40
My android application has two kinds of preferences: 1) I have user preferences defined in res/xml/preferences.xml so that users can manage their preferences with a PreferenceActivity. 2) I'd like to define another file for global configuration preferences of my app. What is the best way to manage my app config preferences? Should I create another XML file with config values or should I specify those config values in strings.xml? What is the best practice for managing config preferences? Pentium10 Preference files are not storead in project's /res/xml/defaults.xml They are stored on the device

Subversion and shared files across repositories/projects?

风流意气都作罢 提交于 2019-11-28 21:11:28
I am migrating a client's SourceSafe repository (3 projects) to SVN and two of the projects share source files. (These projects are separate products - with different names and release versions, etc) Has SVN resolved this shortcoming? How do people generally handle this scenario? Of the options I know about/can think of Use the external or extern or whatever for SVN. I hear this is not a good option for various reasons Create a new project (maybe called shared) that contains the source. The problem with this is that we still have to get that code (it is not a library) and import it into the

how is a shared library file called by two different processes in Linux?

时光怂恿深爱的人放手 提交于 2019-11-28 18:01:20
问题 In Linux, I have a shared library file called foo.so When I execute 2 different process p1, p2 that both use foo.so. Does this foo.so get overlapped by those 2 process? 回答1: On Unix-based systems (includes Linux), the code segment (.text) may be shared among multiple processes because it's immutable. Is this overlapping you mention? Basically, each shared library that contains static data (such as global variables) has a Global Offset Table (GOT). On shared libraries, all references to static

How to create a Shared Login Service across Multiple Domains?

烂漫一生 提交于 2019-11-28 15:44:27
I'm interested in how to implement a shared cross-domain login system as well as best practices and security precautions to take. If you are familiar with 37Signals, you are probably accustomed to their usage of having a shared universal authentication mechanism whereby you do not have to subsequently login if you use the top level navigation to a different product. I would like to implement something in a similar fashion. The closest thing I've found online is the Wikipedia entry on a Central Authentication Service and the response to Cross Domain Login - How to login a user automatically

Push git changes to a shared network drive

一曲冷凌霜 提交于 2019-11-28 15:00:01
How can a team of four people use Git (specifically Github for Windows ) to push local changes to a shared network drive? Right now (without Git) we have to copy the files from the network drive to our local machine, edit the files, and then re-upload them to the shared network drive. This is a painstaking process that can lead to lots of errors, but it seems like something Git could help us with. Can we simply install Git on the shared drive and go from there? Not sure if you found something that works for you or not, but I have a writeup on how to do that very thing on a windows network

Can't create shared library with static inside

隐身守侯 提交于 2019-11-28 11:46:27
Please help I search throw whole internet but I can't find answer ... C Layer I have created simple function int mean(int, int); and place it in calc_mean.h and initialize it in calc_mean.c here are this two files. calc_mean.c #include "calc_mean.h" int mean(int a, int b) { return (a+b) / 2; } calc_mean.h int mean(int, int); Then I create make file and build archive (.a) file called Test_Archive.a using following make file makefile GCC := C:\Tools\ndk-toolchain\ndk-standalone\bin\arm-linux-androideabi-gcc.exe GPP := C:\Tools\ndk-toolchain\ndk-standalone\bin\arm-linux-androideabi-g++.exe AR :=

Analyzing memory access coalescing of my CUDA kernel

只愿长相守 提交于 2019-11-28 11:25:28
I would like to read (BS_X+1)*(BS_Y+1) global memory locations by BS_x*BS_Y threads moving the contents to the shared memory and I have developed the following code. int i = threadIdx.x; int j = threadIdx.y; int idx = blockIdx.x*BLOCK_SIZE_X + threadIdx.x; int idy = blockIdx.y*BLOCK_SIZE_Y + threadIdx.y; int index1 = j*BLOCK_SIZE_Y+i; int i1 = (index1)%(BLOCK_SIZE_X+1); int j1 = (index1)/(BLOCK_SIZE_Y+1); int i2 = (BLOCK_SIZE_X*BLOCK_SIZE_Y+index1)%(BLOCK_SIZE_X+1); int j2 = (BLOCK_SIZE_X*BLOCK_SIZE_Y+index1)/(BLOCK_SIZE_Y+1); __shared__ double Ezx_h_shared_ext[BLOCK_SIZE_X+1][BLOCK_SIZE_Y+1];

Can the same DLL data be shared by 2 different processes?

南楼画角 提交于 2019-11-28 11:24:39
I have two different C# applications that are running at the same time. I would like both of them to be able to access the same "instance" of a DLL (also in C#). The DLL holds some data that I'd like to return to whichever of the two applications is asking for it. My DLL is thread-safe so I was hoping this would be possible but I'm not sure how. Any help or advice would be much appreciated. The process space will be different so, for example, global variables in the DLL will be specific to each separate process. It is possible that the code in memory will be shared (Windows typically uses

Access Shared Network Folder

核能气质少年 提交于 2019-11-28 10:21:47
I need to access via VBA a folder hosted on a Network File Server. The folder is accessible in writing only via a Service Account (different from normal user accounts) for which I do have username and password. Via the UI I can see that folder and map it as a local drive but in order to access it in writing I need to log off from Windows and logon via the Service Account. Is there any way to access the network folder during a normal user session but hardcoding username and pwd in the VBA code? I did try mapping the folder as local drive with: Set WshNetwork = CreateObject("WScript.Network")