I'll try to keep this short, but basically I need to figure out a way to load data in shared memory (this file will be called load.c) I will later access the data with a print.c program.
The "data" is in the form of a student database that looks like this
I store it in a struct that i defined in a header file that looks like this(the ssn's are fake obviously, they are later used for a "change.c" portion)
Basically Im trying to figure out the best way to load an undefined number of "entires" of students into shared memory, so that I can access them later. I think I have the beginning part done...
However Im unsure of how to go about reading them in, I would assume I could store them in a vector/array.....but I wouldn't know how to do that when It came around to accessing them, especially when I dont know how many there are.
I do need to provide mutual exclusion (no more than one writer, but as many readers as I want)...altho Im a bit unsure of how many sephamores to use, I was using a default of 5.....but Im not sure if that is correct...Also I know i need to synchronize concurrent access since multiple writers/readers will be accessing change.c. The whole sephamores thing is a tad confusing tho...
Any hints/ideas/tips would be SUPER helpful. im not asking for an answer, but maybe a point in the right direction. Shared memory is a new thing for me.
HI,
I am dynamically loading shared libraries using shl_load(). There are multiple processes (50 or more) which loads the same shared library. Will Unix internally load only one copy of the shared library or it will load multiple copies.
Can I have memory issues if this is done.
Thanks,... (1 Reply)
I am debugging in gdb a program that dynamically loads libodbcinst.so. I want to debug the code from libodbcinst - I can break in it, see the source and step through it, but whenever I try printing a variable, I get (e.g. for the variable ret):
No symbol "ret" in current context.
In my program... (0 Replies)
Hello,
I wonder if I can write my userdefined data structures(ex: a list) to a shared memory segment?
I know, the shm functions get (void*) parameter so I should be able to read and write a list into the shared memory.
may someone inform and clarify me about that, please? (1 Reply)
Hi All
I have been given by someone else header file and a shared library to be used by my C++ application. Compilation is fine but when I try to executes the application I receive the following error.
./first: error while loading shared libraries: libMyLib.so.9: cannot open shared object file:... (2 Replies)
Hi,
I have an application running on AIX. The app is deployed on Webspshere server. Due to some reason, i have to make use of a third party library (Sigar API's) from my application. This library requires an .so file as well.
Is there any location where i can put this *.so file and it will... (1 Reply)
Hello.
I am new to this forum and I would like to ask for advice about low level POSIX programming.
I have to implement a POSIX compliant C shared library.
A file will have some variables and the shared library will have some functions which need those variables.
There is one special... (5 Replies)
Hello,
I am trying to run a program from my local account and receive the following error:
/local/app: error while loading shared libraries: libtiff.so.3: cannot open shared object file: No such file or directory
On the root account (which I DO NOT have access to), I see that libtiff.so.4... (3 Replies)
I am trying to run a C++ program which uses a static library libprun.a. During compilation, I am loading this library file using a environment variable as below.
LIBDIR = ${CUSTOM_PATH}/lib
LOADLIBS = $(LIBDIR)/libgqlcomm.a \
$(LIBDIR)/libgsml.a \
... (7 Replies)