Thread: linux writing often on main disk

  1. #16
    Alessio Stella
    Join Date
    May 2008
    Location
    Italy, Bologna
    Posts
    251
    oh that's cool but it then prevents me from measuring the time for writing to the hard disk!!

  2. #17
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by mynickmynick View Post
    oh that's cool but it then prevents me from measuring the time for writing to the hard disk!!
    No, but it may prevent you from getting an accurate measurement for a short sequence of writes.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  3. #18
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,268
    You can get around this by making your test use direct IO. Open the file with the O_DIRECT option set, and it wont cache the writes. Keep in mind that you will need to make all your writes page aligned (usually 4096 bytes).

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. ReadyBoost for Linux?
    By cyberfish in forum Tech Board
    Replies: 0
    Last Post: 06-07-2009, 04:52 AM
  2. C99 and int main()
    By cwr in forum C Programming
    Replies: 8
    Last Post: 09-19-2005, 06:54 AM
  3. Writing Linux Drivers
    By Jperensky in forum Linux Programming
    Replies: 1
    Last Post: 03-20-2002, 09:30 AM
  4. void or int for main?:)
    By bigtamscot in forum C Programming
    Replies: 13
    Last Post: 09-27-2001, 03:11 AM