On Wed, 14 Nov 2007 03:19:46 +1000, Art <> wrote:
> Hello all,
>
> I have been working for sometime now on a web based control system.
> This has both a configuration and operational interface from the web.
> As well as the same controls in hardware. I have been currently
> using a sqlite database for storage of the main data. This doesn't
> seem to be a problem when reading but when I write to the data base
> this could take some time. I really need this to be real time as in
> fractions of a second. I have been looking at shared memory(shm.h) to
> share resources between applications. My problem is the shared memory
> is not big enuf for 4mg to 10 mg worth of data. there is not much I
> can do to shrink that size. I really need to share a data structure
> between applications or process that resides in memory. I would hope
> there would be a way for me to create that data structure in own
> program and pass a pointer to another program to access it. I know i
> would normally get a segmentation error if I try to access memory in
> another programs space. I may need to other IPC methods but I really
> want to allow the programs to function independent from each other. I
> don't really care about race conditions because the data is all last
> action. I just care what the last change was.
threads are your friend. See
http://triffid.funkmunch.net/cfindcar/findcar.c for an example - that
program grabs frames from an ip camera in one thread, and decodes and
processes them in the other. The mutexes keep everything nicely
synchronised, and it simply drops any frames it doesn't have time to
process.
You should be able to use mmap to efficiently pass data between processes
if threads don't suit you, or at least pipes/fifos.
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|