Re: What's DMA



DMA is completely unrelated to the concept of asynchronous I/O. First, it is a hardware
capability; it is only availvable if your hardware supports it. This doesn't matter at
application level, because only device driver writers would have the ability to access
this. It doesn't matter to you whether a device does DMA or not. Asynchronous I/O means
that your program does not block while doing I/O, and it can do I/O like this even for
non-DMA devices (your friend sounds like an EE type who doesn't write code. EEs think of
DMA; programmers think of asynchronous I/O).

Note that file I/O often blocks, even if done asynchronously; see KB article 156932.
Therefore, if you really don't want to block, you should probably do your I/O from a
separate thread. My own preference is to use I/O Completion Ports for async I/O, but if
you're doing it in a separate thread, it may not matter that you block (since you're going
to block anyway).

Note that synchronicity is forced for file I/O, even though disk controllers use DMA, so
DMA is unrelated to the concept of asynchronous I/O.
joe

On Wed, 22 Aug 2007 03:30:01 -0700, Charles Tam <CharlesTam@xxxxxxxxxxxxxxxxxxxxxxxxx>
wrote:

I need to do some asynchronous file writing operations in one of my
application, such as, it does not block the main thread.

My friend said to me to use DMA. Does anyone know what it is? Is DMA
available for access from MFC or Win32?
Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.