[NTLUG:Discuss] Disk I/O timings.

Steve Baker sjbaker1 at airmail.net
Wed Dec 5 21:01:52 CST 2001


Bug Hunter wrote:

>   In my real-time embedded application, I use shared memory.
> 
>   The shared memory task writes a formatted message to the shared memory
> and sends a message via a fifo to another task. The message includes the
> address of the beginning of the formatted message. The shared memory is
> big enough to handle a lot of formatted messages and data, determined
> somewhat empirically.  It is used as a ring buffer of messages.

Right - what I was *hoping* was that by mmap'ing the file, I could avoid
the memory copying inherent in using read() to fetch the bytes out of the
kernel buffer and into local memory.  Also, since a mmap'ed memory area can
be made available to all threads of a process, it *is* shared memory.
 
>   This other task deals with the data and does the open and close and
> write, etc.  This allows it to sometimes be fast, sometimes be slow, etc.
> The original task now has a more well known execution time.  If the disk
> is slow, the recipient task is delayed, and the first task continues to
> execute.
> 
>   This smoothes out the bumps in the road.

Yes.

----------------------------- Steve Baker -------------------------------
Mail : <sjbaker1 at airmail.net>   WorkMail: <sjbaker at link.com>
URLs : http://www.sjbaker.org
       http://plib.sf.net http://tuxaqfh.sf.net http://tuxkart.sf.net
       http://prettypoly.sf.net http://freeglut.sf.net
       http://toobular.sf.net   http://lodestone.sf.net




More information about the Discuss mailing list