Re: sharing memory with non-children
- From: Pascal Bourguignon <spam@xxxxxxxxxxxxxxxx>
- Date: Tue, 24 Jan 2006 09:14:48 +0100
Logan Shaw <lshaw-usenet@xxxxxxxxxxxxx> writes:
>> How many and how big do you have to go?
>
> Well, basically the specific reason is that I'm toying with writing a
> program that will stream large amounts of data from one process to
> another. In principle, I could just use a pipe, but for performance
> reasons, shared memory seems better. I've already written a test
> program that uses shared memory and semaphores to make a pseudo-pipe
> between a parent and its child, but I'd like to be able to do it
> between arbitrary processes, or at least to know whether it's possible.
If you STREAM the data from one process to the another, you don't
necessarily need a big buffer. The size of the shared memory circular
buffer you'll use will impose a synchronization between the two
processes, the smaller the more synchrones they'll be, but it is
entirely independant of the size of the data to be STREAMED.
> Anyway, the thing is that I would like the user to be able to say how
> large a buffer they need: some of this data might come from disk and
> stream over the network (or vice versa), so larger buffers are better,
Even large buffers can be filled.
> and for performance reasons, I'd rather avoid copying the data more
> than necessary, which means a large shared buffer is even better.
> And the number of buffers needed would just depend on what the user
> is trying to accomplish.
>
> Also, in general, I hate putting arbitrary limits on things if there
> is no good reason to do so. It just makes your software suck. :-)
>
> - Logan
--
__Pascal Bourguignon__ http://www.informatimago.com/
"Specifications are for the weak and timid!"
.
- Follow-Ups:
- Re: sharing memory with non-children
- From: Logan Shaw
- Re: sharing memory with non-children
- References:
- sharing memory with non-children
- From: Logan Shaw
- Re: sharing memory with non-children
- From: Ian Collins
- Re: sharing memory with non-children
- From: Logan Shaw
- sharing memory with non-children
- Prev by Date: Re: The fastest mechanism of IPC
- Next by Date: Re: How to detect that stdin was closed.
- Previous by thread: Re: sharing memory with non-children
- Next by thread: Re: sharing memory with non-children
- Index(es):
Relevant Pages
|