I'm not much of a real-time expert either, so I can't comment a whole lot.
Regarding the buffer size, I used a std::vector so the first few calls will
allocate extra memory but it should settle down (hopefully).
On Wed, 15 Oct 2008, Geoffrey Biggs wrote:
> Granted, I don't have a whole heap of experience in real-time
> programming, but from what I do know there are two issues that would be
> involved: allocating the buffer, and copying data to/from the buffer.
> Allocating can be avoided by using a static buffer. This requires that
> the buffer size be chosen carefully in advance based on the
> application's needs (flexiport already has an options facility that
> would make this easy to specify once chosen). The other issue I'm less
> sure about. I don't know what effect copying the data to a buffer
> followed by doing another memcpy out of that buffer into the caller's
> buffer would have on the ability to guarantee execution within a certain
> It would probably be a benefit, overall, to have such buffering done
> within the flexiport classes so that anyone using them gets the benefits
> with no extra work (it would probably also make some of the API
> functions much more efficient), I just need to figure out these issues
> first. One of the aims of flexiport was to be able to work in a
> real-time environment as much as possible.
> Alex Brooks wrote:
> > Hi Geoff,
> >> As a more long term thing, I may look into static application-side
> >> buffers, with all data pulled out of the OS buffers as soon as it's
> >> available and distributed to the caller only when asked for (this would
> >> also get around winsock's problems). I have concerns about the effect of
> >> this on real-time support and low-memory devices, though, so it would
> >> likely be an option.
> > What do you mean by the reference to real-time support?
> > [I'm curious because this is close to what I did with my SICK driver].
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge Build the coolest Linux based applications with Moblin SDK & win
> great prizes Grand prize is a trip for two to an Open Source event anywhere
> in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/
> Gearbox-devel mailing list