Execution Question

This is a discussion on Execution Question within the Windows Programming forums, part of the Platform Specific Boards category; Hi, I have written some code to test the efficiency of some algorithms in real world. Now, i think it ...

  1. #1
    Registered User
    Join Date
    Dec 2006
    Posts
    60

    Execution Question

    Hi,
    I have written some code to test the efficiency of some algorithms in real world.
    Now, i think it would be better to disable the cpu interrupts but i wonder how to do it.
    Does it have something to do with the compilation ( through compiler arguments )
    or is it something that i should ask for the OS to do when executing the application ?

    Any help is appreciated

    PS: I use the mingw compiler

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,761
    You're not going to disable the interrupts or any other high priority services on any pre-emptive desktop operating system.

    I recently had to time some code on a desktop machine. My approach was to repeat the test 100's or 1000's of times and plot graphs of the timings. The minimum timings were pretty stable from one run to another, but the maximum times showed like ±100% variability in the results, depending on course on exactly what other things happened to momentarily interrupt the test.

    The "best" you can manage is to up the priority (you need admin to do it IIRC), but beware of running long duration tasks at very high priority, you might upset something.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Registered User
    Join Date
    Jul 2007
    Posts
    36
    You can run your program in realtime which means that it will hog up the CPU. Most interrupts should be disabled. You can set the priority of execution for your program to realtime through the Windows API or the task manager. Be careful, though.
    FrancoisSoft
    FrancoisSoft on the Web
    If you stare at a computer for 5 minutes you might be a nerdneck.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. another do while question
    By kbpsu in forum C++ Programming
    Replies: 3
    Last Post: 03-23-2009, 01:14 PM
  2. Execution Time - Rijandael encryption
    By gamer4life687 in forum C++ Programming
    Replies: 5
    Last Post: 09-20-2008, 10:25 PM
  3. Question about pointers #2
    By maxhavoc in forum C++ Programming
    Replies: 28
    Last Post: 06-21-2004, 01:52 PM
  4. Question...
    By TechWins in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 07-28-2003, 10:47 PM
  5. Question, question!
    By oskilian in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 12-24-2001, 01:47 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21