> Please excuse a "not necessarily linux" question, but who wants to share
> opinions/experience on the virtues of mmap ing a file as opposed to opening it
> ? I'm about to start work on a project where the local custom is to mmap input
> files and I'm not so sure that's a good idea (the files and 100s of meg).  Are
> page faults really that much faster than reads ?

Depending on the options passed to mmap(2), MAP_SHARED vs MAP_PRIVATE,
the kernel can map the buffer cache pages directly into the process's
address space.  This will avoid the copy from kernel space to the user
space buffer you'd would have to supply with a read(2) call.

Pat

-- 
Patrick O'Rourke
[EMAIL PROTECTED]

**********************************************************
To unsubscribe from this list, send mail to
[EMAIL PROTECTED] with the following text in the
*body* (*not* the subject line) of the letter:
unsubscribe gnhlug
**********************************************************

Reply via email to