C/C++ :: Know That Data Written To Shared Memory Segment In Unix Is Stored Properly
Mar 8, 2012
I am trying to write a client/server application that takes input to an array of structures from the user,stores the data in a shared memory segment and then writes the same to a file when I close the application. How do I get started? And how do I ensure that the server stores the data correctly? Also, the server needs to be a concurrent server that accepts connections from multiple clients.
View 1 Replies
Sep 28, 2013
printf is a part of code segment but found in data segment.....why is it so ?
View 7 Replies
View Related
Mar 21, 2013
So, if I'm right, computer store their data as binary values. So if I write int x = 5; , my computer converts the value of x from decimal (5) into binary (101) and stores it in memory as a a binary number. If I print that value on the screen that value is converted(by default) back into a decimal number before being printed on the screen.
Now, my question is if there is any way to print the value of x directly into binary(as it's stored in memory) without it being converted back into a decimal value?
View 10 Replies
View Related
May 22, 2013
I have created a shared object in Ubuntu (libMYLIB.so). I am now trying to compile a simple test program (testmylib.c) to see if the shared object is properly built. I am getting an error that the build cannot find the shared object. My build command is:
gcc -lm -l /dir/mylib -lMYLIB.so -o testmylib testmylib.c
where /dir/mylib is where my source and libMYLIB.so reside.
What am I doing wrong?
View 9 Replies
View Related
Dec 26, 2012
My Application is C# winform
I am facing below error at the time of form close and end of Dispose() method .
The instruction at "0xXXXXXXXX" referenced memory at "0xXXXXXXXX", The memory could not be "written". Click on OK to terminate that program.
how to avoid / catch this error .
View 3 Replies
View Related
May 31, 2013
I would like to cipher data segmet of my executable say with a simple Caesar Cipher algorithm, i.e. any text should not be readable when executable opened with a hex editor.
It should be something that converts my plain text into a ciphered form at compile time(CPP?), and when executable is being run, should be able to convert ciphered data into human readable text.
I thought meta-programming could be the approach for this. Also, implementing complex algorithms with C pre-processor (CPP) sounds vulnerable (well, depends on one's coding skills let me say)
View 1 Replies
View Related
Apr 13, 2014
Say now I have a dll, loaded and run by a 32bit program. One of the things that I access from the program in the dll are several 1024x1024 int buffers. However I would like to put some data into those buffers from a external process. And I would like a separate thread in that external process for each buffer. Is there any way I can make that memory space accessible to the external process so I can use my own multi threaded memory transfers to pass that data over provided I ensure that the original process doesn't try to do anything with that data? And I would like to do this without resorting to the Read/WriteProcessMemory functions which are not threadsafe. In short, I want to set up direct memory access between the 2 programs without creating any intermediate shared memory buffers ie I want to set permissions for an existing memory space. Is this possible?
View 1 Replies
View Related
Feb 9, 2013
I am not so experianced with c++ myself, but I need to evaluate if a certain idea might work.
I am working with a system for automation purposes that is running on a realtime OS in parallel to windows. Windows and the RTOS exchange data via shared memory. The application in the RTOS is compiled in C++. Now I would like to be able to influence the some data manipulation tasks in the RTOS application without changing the code of the RTOS application. So a concept like calling a dll.
My idea was to create a class with virtual methods in the RTOS application. The objects that are used should then be created on the Windows side with the same class prototype, but specific implementation of the virtual methods. The objects should then be moved to the shared memory, where they are used by the RTOS application.
Is something like this possible or am I completly on the wrong path?
View 4 Replies
View Related
May 27, 2014
In interprocess communication(IPC) when processe have to share data among each other,why cant they all connect to one single file and share data with basic file handling functions such as read and write?
Why do we need
shared memory(shmget shmat(),shmdt()..etc)
and
mapped memory(mmap(),munmap()..etc)
concepts?
View 3 Replies
View Related
Jan 16, 2014
I have one requirement to store an array of structure at shared memory. Also the shared memory should have one counter to store number of elements in the array.
I tried to look at some placed but didn't find anything relevant.
So my first question, is it possible that we can store two things on same shared memory. And second if not then how to achieve the same?
View 5 Replies
View Related
Dec 8, 2014
I am trying to initialize a 2D char array of strings into POSIX shared memory to be shared between 3 other processes. There are plenty of tutorials on how to use a pointer to share a single string or an integer between processes, but I could find no examples on how to initialize 1D or 2D arrays using mmap(). I have posted what I have so far below. It is the first program, which creates the shared memory object and initialize the array char files[20][2][100] with the value files[0][0][0] = '