Re: Ram Drive Question Dec. 17, 2009

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



E.D.G. wrote:
Data need to be shared between multiple computer programs that are running at the same time. They can be easily stored on the computer's hard drive and then accessed by the various programs. But one of the goals here is to send CD based demonstration versions of the programs to governments and researchers around the world. And when the programs run it would be nice if they could share the necessary data without storing any files on the person's computer.

Software initiated "Pipes" are too slow for the large amounts of data involved. And some of the programs are unable to read the Windows Clipboard. So data cannot be shared in that manner.

Hi EDG,

I have more questions than answers. Are you developing these programs yourself? That is, can you control how the programs communicate with each other? If so, then the right Windows IPC mechanism to use would probably be either Shared Memory, or an in-memory database; rather than a RAM disk.

A disk (whether RAM or physical) is only useful when the applications are reading and writing via File I/O. File I/O can be useful in some situations but it's nearly always a bad choice when performance is important. Likewise, a RAM disk is rarely a good idea on Windows; because Windows' regular memory management and system cache can make better use of that memory, improving overall performance. Usually a RAM disk is only useful when an application insists on doing File I/O but needs to share data at high speed - a bit like saying "I want a car which is both incredibly fast, and is also incredibly fuel-efficient" :-). They're contradictory goals.

When you mention pipes, do you mean Win32 Pipes? These do not need to be slow, if they are running on the same machine, or between well-connected machines (eg same LAN). Pipes are usually slow over a WAN connection. If running on the same machine, a Pipe can run at near-memory speeds - they shouldn't be any slower than File I/O to a RAMDisk.

Shared memory:

http://msdn.microsoft.com/en-us/library/aa366551%28VS.85%29.aspx

Pipes:

http://msdn.microsoft.com/en-us/library/aa365780(VS.85).aspx

If you have a bunch of programs which you have no control over (eg you didn't write them yourself) then, you may be kind of stuck.

Regards

Andrew

--
amclar at optusnet dot com dot au
.



Relevant Pages

  • Re: What is your favorite parallel programming paradigm?
    ... But IMHO you can do better than the pipe syntax. ... Those are the semantics you get under eager evaluation. ... threads and shared memory. ... There is nothing that prevents pipes from being implemented using pigeons. ...
    (comp.lang.misc)
  • Re: sockets and pipes....
    ... >>shared memory instead of pipes? ... >>manage all your pipes. ... > So the server app may have to do a lot of processing for each request. ... If you want to cache values and your master process is multithreaded, ...
    (comp.os.linux.misc)
  • Re: sockets and pipes....
    ... >>shared memory instead of pipes? ... >>manage all your pipes. ... > So the server app may have to do a lot of processing for each request. ... If you want to cache values and your master process is multithreaded, ...
    (comp.os.linux.development.system)
  • Re: send data to another program in C
    ... I have a program that solves linear ... >> Aand bcalled ccx. ... Alternatively you can use shared memory either Sys V shm or a shared ... Pipes are probably best for a small ...
    (comp.unix.programmer)