LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   IPC-shared memory (https://www.linuxquestions.org/questions/linux-server-73/ipc-shared-memory-532463/)

hegdeshashi 02-26-2007 02:47 AM

IPC-shared memory
 
HI,

I am using shared memory as my IPC.Here I am having some web pages.Using shared memory ,I am opening ,and here this web page every 30 seconds it is refreshing.And aslo,same page is used by both server and client.For Ex=rediff.com home page.If every 30 second ,it is updating means,every client can see the changes.

Now,my problem is how to update it.I mean ,how to save this ?

can any one give me some hints.

Thanks in advance.

nmh+linuxquestions.o 02-26-2007 05:31 AM

I do not understand what you are trying to do and why, so it might help for you to restate your situation/question. That said, taking your question at face value:

If you want to save the shared state to disk for later access - maybe you could have a special client process that just saves it.

If you want to update the memory with what you download, I think you can just change it and the clients should see it (if that is what you are doing/want to do, I would suggest that you investigate locking for this).

hegdeshashi 02-26-2007 11:02 PM

Hi,


I am having some web pages ,that is opened by a server,And now one client is opening a same page and that is going to update that page and same page can see by both server and client.Now ,if server is changing some thing on that page,then client can
see the updates.

So ,can anyone one give me some thing good idea?

nmh+linuxquestions.o 02-27-2007 01:05 AM

Are you talking about an HTTP server and HTTP clients?
Why do you want to use shared memory? Why not a file?

If you are talking about a mechanism to allow updating a file without restarting the server - why are you trying to impliment this on your own? Is there some reason you are not using thttpd, apache, jigsaw or some other HTTPD?

If you want to have two processes send data to each other, why not use pipes, named pipes, or specific memory segments?

hegdeshashi 02-27-2007 02:50 AM

yes,

I am using shared memory segments to store those parameter values whatever changed by server/client.

Is it not possible from shared memory, if suppose I am using some file?

nmh+linuxquestions.o 02-27-2007 03:46 AM

Quote:

Originally Posted by hegdeshashi
yes,

I am using shared memory segments to store those parameter values whatever changed by server/client.

Is it not possible from shared memory, if suppose I am using some file?

Would you be able to post a sample of your code (maybe not everything, but just a small example of what you want to do)?

I do not do much with IPC SHM, but from my understanding, there is nothing to stop you from reading what is in some portion of the SHM. Are you having trouble with that?

Moving on to the scattershot style - could you glance over
http://www-128.ibm.com/developerwork...ibrary/au-ipc/

and maybe also:
http://users.actcom.co.il/~choo/lupg...i-process.html

Do you have that much working for your IPC, or is that the part you are having difficulty with?


All times are GMT -5. The time now is 01:26 AM.