[NTLUG:Discuss] Disk I/O timings.
Bug Hunter
bughuntr at one.ctelcom.net
Wed Dec 5 14:00:02 CST 2001
On Wed, 5 Dec 2001, Steve Baker wrote:
<snip>
> I'm writing an embedded realtime system here - I can tolerate or work-around
> delays *if* I know when they'll happen.
>
> I know that the disk accesses (even if utterly perfectly optimised) are
> going to take enough time to be very significant to my application
> - but I need to understand *WHEN* that hit will occour so that I can take
> precautions to avoid it's effects (eg by running that step in a parallel
> thread).
>
> That's why I want to know at what point in my open/fstat/mmap/read-memory/munmap/close
> cycle the delay will hit my program and cause it to block.
>
<snip>
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.
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.
bug
More information about the Discuss
mailing list